handle shows without season folders
This commit is contained in:
@@ -73,7 +73,15 @@ export default function TvView({ libraryId }: Props) {
|
||||
setError(null)
|
||||
fetch(`/api/tv?libraryId=${encodeURIComponent(libraryId)}&seriesId=${encodeURIComponent(s.id)}`)
|
||||
.then((r) => r.json())
|
||||
.then((data) => { setSeasons(data); setLoading(false) })
|
||||
.then((data: TvSeason[]) => {
|
||||
setSeasons(data)
|
||||
setLoading(false)
|
||||
// Flat series: a single synthetic season (id='.') means episodes live
|
||||
// directly in the series folder — skip the seasons screen automatically.
|
||||
if (data.length === 1 && data[0].id === '.') {
|
||||
openSeason(data[0])
|
||||
}
|
||||
})
|
||||
.catch(() => { setError('Failed to load seasons'); setLoading(false) })
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user