Fix manage, chapters edit tracks and library stats page not setting the current library properly #4170
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build and Push Docker Image / build (push) Waiting to run
Integration Test / build and test (push) Waiting to run
Run Unit Tests / Run Unit Tests (push) Waiting to run
Run Component Tests / Run Component Tests (push) Has been cancelled

This commit is contained in:
advplyr 2025-03-30 17:27:36 -05:00
parent 8bea5d83f5
commit ddcda197b4
4 changed files with 22 additions and 4 deletions

View file

@ -103,6 +103,12 @@ export default {
console.error('No need to edit library item that is 1 file...')
return redirect('/')
}
// Fetch and set library if this items library does not match the current
if (store.state.libraries.currentLibraryId !== libraryItem.libraryId || !store.state.libraries.filterData) {
await store.dispatch('libraries/fetch', libraryItem.libraryId)
}
return {
libraryItem,
files: libraryItem.media.audioFiles ? libraryItem.media.audioFiles.map((af) => ({ ...af, include: !af.exclude })) : []