Episodes of a channel season are missing until the season's metadata refresh has run
Description of the bug
When a channel plugin provides series (ChannelFolderType.Series / Season with ChannelMediaContentType.Episode items), opening a season right after opening its series shows no episodes. Waiting a few seconds, or reloading, shows them.
The episodes of a season are listed by Series.GetSeasonEpisodes, which queries the channel and then filters the library on SeriesPresentationUniqueKey (with the default DisplaySpecialsWithinSeasons), or on the ancestors of the season otherwise. For items found by a library scan, PresentationUniqueKey, SeriesId, SeriesPresentationUniqueKey and SeasonId are set by the metadata refresh (MetadataService, SeasonMetadataService, EpisodeMetadataService). ChannelManager.GetChannelItemEntityAsync creates channel items without them and only queues that refresh in the background, so the episodes it has just created do not match the query until their refresh has run. The more refreshes are queued, the longer the episodes stay missing.
Users of the Xtream plugin report the symptom in https://github.com/Kevinjil/Jellyfin.Xtream/issues/253.
Reproduction steps
- Install a channel plugin which provides series, e.g. Jellyfin.Xtream.
- Open a series which has never been browsed, and right away one of its seasons.
What is the current bug behavior?
The season shows no episodes. They appear a few seconds later, once their metadata refresh has run.
What is the expected correct behavior?
The episodes show the first time the season is opened.
Jellyfin Server version
12.1
Specify commit id
No response
Specify unstable release number
No response
Specify version number
No response
Specify the build version
12.1
Environment
- OS: Debian 13 (official jellyfin-server 12.1+deb13 package)
- Linux Kernel:
- Virtualization:
- Clients: Web
- Browser:
- FFmpeg Version:
- Playback Method:
- Hardware Acceleration:
- CPU Model:
- GPU Model:
- Plugins: Jellyfin.Xtream 0.8.1.1
- Reverse Proxy:
- Base URL:
- Networking:
- External Integrations:Jellyfin logs
Nothing is logged: the requests succeed, the items are only missing from their response.FFmpeg logs
No response
Client / Browser logs
No response
Relevant screenshots or videos
No response
Additional information
The bug is also present on master at 3655c6861d, where the relevant code is unchanged.
Source: jellyfin/jellyfin