fix issue 51 library reclassify regressions

This commit is contained in:
ShukeBta
2026-06-27 00:40:39 +08:00
parent 4c839b3f4e
commit 8d0aa2b589
15 changed files with 371 additions and 35 deletions
+18 -4
View File
@@ -27,10 +27,24 @@ export function useLibraryData(libraryID: string, selectedSeries: SeriesCard | n
useEffect(() => {
if (!libraryID) return
libraryAPI.list().then((all) => {
const lib = all.find((item) => item.id === libraryID) ?? null
setLibrary(lib)
})
let cancelled = false
setLoading(true)
setLibrary(null)
setItems([])
setServerSeriesCards([])
setSeriesEpisodeItems([])
libraryAPI.get(libraryID)
.then((lib) => {
if (!cancelled) setLibrary(lib)
})
.catch(() => {
if (!cancelled) {
setLibrary(null)
setLoading(false)
toast.error('媒体库不存在或无权限')
}
})
return () => { cancelled = true }
}, [libraryID])
useEffect(() => {