This commit is contained in:
advplyr 2022-04-15 20:48:39 -05:00
parent ccba8dc3c7
commit ae195e7b58
32 changed files with 626 additions and 191 deletions

View file

@ -9,7 +9,7 @@ export const getters = {
getDownloadItem: state => (libraryItemId, episodeId = null) => {
return state.itemDownloads.find(i => {
if (episodeId && !i.episodes.some(e => e.id == episodeId)) return false
return i.id == libraryItemId
return i.libraryItemId == libraryItemId
})
},
getLibraryItemCoverSrc: (state, getters, rootState, rootGetters) => (libraryItem, placeholder = '/book_placeholder.jpg') => {
@ -32,7 +32,7 @@ export const getters = {
},
getLocalMediaProgressById: (state) => (localLibraryItemId, episodeId = null) => {
return state.localMediaProgress.find(lmp => {
if (episodeId != null && lmp.episodeId != episodeId) return false
if (episodeId != null && lmp.localEpisodeId != episodeId) return false
return lmp.localLibraryItemId == localLibraryItemId
})
}
@ -73,8 +73,10 @@ export const mutations = {
}
var index = state.localMediaProgress.findIndex(lmp => lmp.id == prog.id)
if (index >= 0) {
console.log('UpdateLocalMediaProgress updating', prog.id, prog.progress)
state.localMediaProgress.splice(index, 1, prog)
} else {
console.log('updateLocalMediaProgress inserting new progress', prog.id, prog.progress)
state.localMediaProgress.push(prog)
}
},