mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-09 13:28:43 +02:00
Fix:Remove last saved library id when changing servers so home page shelves load on init
This commit is contained in:
+4
-1
@@ -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) => {
|
||||
|
||||
@@ -90,6 +90,7 @@ export const mutations = {
|
||||
},
|
||||
reset(state) {
|
||||
state.lastLoad = 0
|
||||
state.currentLibraryId = null
|
||||
state.libraries = []
|
||||
},
|
||||
setCurrentLibrary(state, val) {
|
||||
|
||||
Reference in New Issue
Block a user