Add settings page with adjustable jump forward/backward settings

This commit is contained in:
advplyr 2022-07-01 20:05:11 -05:00
parent a41e26e4c6
commit 3c1120ea48
13 changed files with 162 additions and 66 deletions

View file

@ -3,7 +3,35 @@ export const state = () => ({
bookshelfListView: false,
series: null,
localMediaProgress: [],
lastSearch: null
lastSearch: null,
jumpForwardItems: [
{
icon: 'forward_5',
value: 5
},
{
icon: 'forward_10',
value: 10
},
{
icon: 'forward_30',
value: 30
}
],
jumpBackwardsItems: [
{
icon: 'replay_5',
value: 5
},
{
icon: 'replay_10',
value: 10
},
{
icon: 'replay_30',
value: 30
}
]
})
export const getters = {
@ -45,6 +73,14 @@ export const getters = {
if (episodeId != null && lmp.episodeId != episodeId) return false
return lmp.libraryItemId == libraryItemId
})
},
getJumpForwardIcon: state => (jumpForwardTime) => {
const item = state.jumpForwardItems.find(i => i.value == jumpForwardTime)
return item ? item.icon : 'forward_10'
},
getJumpBackwardsIcon: state => (jumpBackwardsTime) => {
const item = state.jumpBackwardsItems.find(i => i.value == jumpBackwardsTime)
return item ? item.icon : 'replay_10'
}
}

View file

@ -1,6 +1,7 @@
import { Network } from '@capacitor/network'
export const state = () => ({
deviceData: null,
playerLibraryItemId: null,
playerEpisodeId: null,
playerIsLocal: false,
@ -35,6 +36,14 @@ export const getters = {
if (!state.serverSettings) return 1
return state.serverSettings.coverAspectRatio === 0 ? 1.6 : 1
},
getJumpForwardTime: state => {
if (!state.deviceData || !state.deviceData.deviceSettings) return 10
return state.deviceData.deviceSettings.jumpForwardTime || 10
},
getJumpBackwardsTime: state => {
if (!state.deviceData || !state.deviceData.deviceSettings) return 10
return state.deviceData.deviceSettings.jumpBackwardsTime || 10
}
}
export const actions = {
@ -55,6 +64,9 @@ export const actions = {
}
export const mutations = {
setDeviceData(state, deviceData) {
state.deviceData = deviceData
},
setLastBookshelfScrollData(state, { scrollTop, path, name }) {
state.lastBookshelfScrollData[name] = { scrollTop, path }
},