mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-09 05:18:40 +02:00
Add:Haptic feedback device setting off/light/medium/heavy #472
This commit is contained in:
@@ -352,17 +352,17 @@ export default {
|
||||
}
|
||||
},
|
||||
async touchstartTrack(e) {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
if (!e || !e.touches || !this.$refs.track || !this.showFullscreen || this.lockUi) return
|
||||
this.touchTrackStart = true
|
||||
},
|
||||
async selectChapter(chapter) {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
this.seek(chapter.start)
|
||||
this.showChapterModal = false
|
||||
},
|
||||
async castClick() {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
if (this.isLocalPlayMethod) {
|
||||
this.$eventBus.$emit('cast-local-item')
|
||||
return
|
||||
@@ -382,13 +382,13 @@ export default {
|
||||
this.forceCloseDropdownMenu()
|
||||
},
|
||||
async jumpNextChapter() {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
if (this.isLoading) return
|
||||
if (!this.nextChapter) return
|
||||
this.seek(this.nextChapter.start)
|
||||
},
|
||||
async jumpChapterStart() {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
if (this.isLoading) return
|
||||
if (!this.currentChapter) {
|
||||
return this.restart()
|
||||
@@ -409,7 +409,7 @@ export default {
|
||||
this.$emit('showSleepTimer')
|
||||
},
|
||||
async setPlaybackSpeed(speed) {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
console.log(`[AudioPlayer] Set Playback Rate: ${speed}`)
|
||||
this.currentPlaybackRate = speed
|
||||
AbsAudioPlayer.setPlaybackSpeed({ value: speed })
|
||||
@@ -418,12 +418,12 @@ export default {
|
||||
this.seek(0)
|
||||
},
|
||||
async jumpBackwards() {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
if (this.isLoading) return
|
||||
AbsAudioPlayer.seekBackward({ value: this.jumpBackwardsTime })
|
||||
},
|
||||
async jumpForward() {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
if (this.isLoading) return
|
||||
AbsAudioPlayer.seekForward({ value: this.jumpForwardTime })
|
||||
},
|
||||
@@ -563,7 +563,7 @@ export default {
|
||||
this.seek(time)
|
||||
},
|
||||
async playPauseClick() {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
if (this.isLoading) return
|
||||
|
||||
this.isPlaying = !!((await AbsAudioPlayer.playPause()) || {}).playing
|
||||
@@ -667,7 +667,7 @@ export default {
|
||||
}
|
||||
},
|
||||
async clickMenuAction(action) {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
this.showMoreMenuDialog = false
|
||||
this.$nextTick(() => {
|
||||
if (action === 'lock') {
|
||||
|
||||
@@ -115,10 +115,10 @@ export default {
|
||||
})
|
||||
} else {
|
||||
items.push({
|
||||
icon: 'download',
|
||||
iconOutlined: false,
|
||||
text: 'Downloads',
|
||||
to: '/downloads'
|
||||
icon: 'download',
|
||||
iconOutlined: false,
|
||||
text: 'Downloads',
|
||||
to: '/downloads'
|
||||
})
|
||||
}
|
||||
items.push({
|
||||
@@ -137,7 +137,7 @@ export default {
|
||||
this.show = false
|
||||
},
|
||||
async logout() {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
if (this.user) {
|
||||
await this.$axios.$post('/logout').catch((error) => {
|
||||
console.error(error)
|
||||
|
||||
@@ -407,7 +407,7 @@ export default {
|
||||
e.preventDefault()
|
||||
this.selectBtnClick()
|
||||
} else if (this.recentEpisode) {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
var eventBus = this.$eventBus || this.$nuxt.$eventBus
|
||||
if (this.streamIsPlaying) {
|
||||
eventBus.$emit('pause-item')
|
||||
|
||||
@@ -132,7 +132,7 @@ export default {
|
||||
}
|
||||
},
|
||||
async connectToServer(config) {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
console.log('[ServerConnectForm] connectToServer', config.address)
|
||||
this.processing = true
|
||||
this.serverConfig = {
|
||||
@@ -160,7 +160,7 @@ export default {
|
||||
},
|
||||
async removeServerConfigClick() {
|
||||
if (!this.serverConfig.id) return
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
|
||||
const { value } = await Dialog.confirm({
|
||||
title: 'Confirm',
|
||||
@@ -192,7 +192,7 @@ export default {
|
||||
this.showAuth = true
|
||||
},
|
||||
async newServerConfigClick() {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
this.serverConfig = {
|
||||
address: '',
|
||||
userId: '',
|
||||
|
||||
@@ -104,7 +104,7 @@ export default {
|
||||
},
|
||||
async changeView() {
|
||||
this.bookshelfListView = !this.bookshelfListView
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
@@ -95,7 +95,7 @@ export default {
|
||||
this.showBookmarkTitleInput = true
|
||||
},
|
||||
async deleteBookmark(bm) {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
const { value } = await Dialog.confirm({
|
||||
title: 'Remove Bookmark',
|
||||
message: `Are you sure you want to remove bookmark?`
|
||||
@@ -114,7 +114,7 @@ export default {
|
||||
this.show = false
|
||||
},
|
||||
async clickBookmark(bm) {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
this.$emit('select', bm)
|
||||
},
|
||||
submitUpdateBookmark(updatedBookmark) {
|
||||
@@ -159,7 +159,7 @@ export default {
|
||||
this.showBookmarkTitleInput = true
|
||||
},
|
||||
async submitBookmark() {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
if (this.selectedBookmark) {
|
||||
var updatePayload = {
|
||||
...this.selectedBookmark,
|
||||
|
||||
@@ -213,7 +213,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async clearSelected() {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
this.selected = 'all'
|
||||
this.show = false
|
||||
this.$nextTick(() => this.$emit('change', 'all'))
|
||||
@@ -232,7 +232,7 @@ export default {
|
||||
this.show = false
|
||||
return
|
||||
}
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
this.selected = val
|
||||
this.show = false
|
||||
this.$nextTick(() => this.$emit('change', val))
|
||||
|
||||
@@ -49,7 +49,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async clickedOption(lib) {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
this.show = false
|
||||
if (lib.id === this.currentLibraryId) return
|
||||
await this.$store.dispatch('libraries/fetch', lib.id)
|
||||
|
||||
@@ -127,7 +127,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async clickedOption(val) {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
if (this.selected === val) {
|
||||
this.selectedDesc = !this.selectedDesc
|
||||
} else {
|
||||
|
||||
@@ -90,36 +90,36 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async clickedChapterOption() {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
this.show = false
|
||||
this.$nextTick(() => this.$emit('change', { time: this.currentEndOfChapterTime * 1000, isChapterTime: true }))
|
||||
},
|
||||
async clickedOption(timeoutMin) {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
var timeout = timeoutMin * 1000 * 60
|
||||
this.show = false
|
||||
this.manualTimerModal = false
|
||||
this.$nextTick(() => this.$emit('change', { time: timeout, isChapterTime: false }))
|
||||
},
|
||||
async cancelSleepTimer() {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
this.$emit('cancel')
|
||||
this.show = false
|
||||
},
|
||||
async increaseSleepTime() {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
this.$emit('increase')
|
||||
},
|
||||
async decreaseSleepTime() {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
this.$emit('decrease')
|
||||
},
|
||||
async increaseManualTimeout() {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
this.manualTimeoutMin++
|
||||
},
|
||||
async decreaseManualTimeout() {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
if (this.manualTimeoutMin > 1) this.manualTimeoutMin--
|
||||
}
|
||||
},
|
||||
|
||||
@@ -115,7 +115,7 @@ export default {
|
||||
})
|
||||
},
|
||||
async clickPlaylist(playlist) {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
if (playlist.isItemIncluded) {
|
||||
this.removeFromPlaylist(playlist)
|
||||
} else {
|
||||
@@ -165,7 +165,7 @@ export default {
|
||||
this.showPlaylistNameInput = true
|
||||
},
|
||||
async submitCreatePlaylist() {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
if (!this.newPlaylistName || !this.selectedPlaylistItems.length) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ export default {
|
||||
},
|
||||
async downloadClick() {
|
||||
if (this.downloadItem) return
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
if (this.isIos) {
|
||||
// no local folders on iOS
|
||||
this.startDownload()
|
||||
@@ -248,7 +248,7 @@ export default {
|
||||
}
|
||||
},
|
||||
async playClick() {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
if (this.streamIsPlaying) {
|
||||
this.$eventBus.$emit('pause-item')
|
||||
} else {
|
||||
@@ -270,7 +270,7 @@ export default {
|
||||
}
|
||||
},
|
||||
async toggleFinished() {
|
||||
await this.$hapticsImpactMedium()
|
||||
await this.$hapticsImpact()
|
||||
this.isProcessingReadUpdate = true
|
||||
if (this.isLocal || this.localEpisode) {
|
||||
var isFinished = !this.userIsFinished
|
||||
|
||||
@@ -61,7 +61,7 @@ export default {
|
||||
return this.selectedItem ? this.selectedItem.text : ''
|
||||
},
|
||||
buttonClass() {
|
||||
var classes = []
|
||||
const classes = []
|
||||
if (this.small) classes.push('h-9')
|
||||
else classes.push('h-10')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user