Fix:Remove last saved library id when changing servers so home page shelves load on init

This commit is contained in:
advplyr
2022-06-05 16:32:28 -05:00
parent d7dcaa22a6
commit 870774b408
10 changed files with 33 additions and 16 deletions
+4 -1
View File
@@ -22,13 +22,16 @@ export const getters = {
if (media.coverPath.startsWith('http:') || media.coverPath.startsWith('https:')) return media.coverPath
var userToken = rootGetters['user/getToken']
var serverAddress = rootGetters['user/getServerAddress']
if (!userToken || !serverAddress) return placeholder
var lastUpdate = libraryItem.updatedAt || Date.now()
if (process.env.NODE_ENV !== 'production') { // Testing
// return `http://localhost:3333/api/items/${libraryItem.id}/cover?token=${userToken}&ts=${lastUpdate}`
}
var url = new URL(`/api/items/${libraryItem.id}/cover`, rootGetters['user/getServerAddress'])
var url = new URL(`/api/items/${libraryItem.id}/cover`, serverAddress)
return `${url}?token=${userToken}&ts=${lastUpdate}`
},
getLocalMediaProgressById: (state) => (localLibraryItemId, episodeId = null) => {
+1
View File
@@ -90,6 +90,7 @@ export const mutations = {
},
reset(state) {
state.lastLoad = 0
state.currentLibraryId = null
state.libraries = []
},
setCurrentLibrary(state, val) {