-
Notifications
You must be signed in to change notification settings - Fork 83
Bug: Watchlisted shows not appearing in Calendar → Upcoming view #1148
Description
Shows that are added to the Watchlist (not tracked under "My Shows") do not appear in the Calendar's Upcoming (Present/Future) view. The calendar only displays upcoming episodes for shows that are in "My Shows".
Although there is existing code in WatchlistAppender.kt that attempts to inject watchlist shows into the calendar, the approach has critical issues that prevent watchlisted shows from being properly displayed.
Root Cause Analysis (Code References)
The calendar loading pipeline works as follows:
CalendarItemsCase.loadItems()(ui-progress/.../cases/items/CalendarItemsCase.kt) fetches bothmyShowsandwatchlistShowsfrom the repository (lines 66–72).- It queries all episodes and seasons from the local database for all combined show IDs (lines 77–90).
- It then calls
WatchlistAppender.appendWatchlistShows()(ui-progress/.../helpers/WatchlistAppender.kt) to inject synthetic episodes for watchlist shows (lines 95–99). - Finally, these episodes are filtered by CalendarFutureFilter (CalendarFutureFilter.kt) which keeps only episodes that are on or after today (
isSameDayOrAfter), haveseasonNumber != 0, and optionally are premieres (lines 22–24).
The issue is in WatchlistAppender.createWatchlistEpisode() (lines 61–85 of WatchlistAppender.kt):
The synthetic episode is created with:
firstAired = nowUtc()→ This sets the air date to right now, not the show's actual next episode air date.seasonNumber = 1andepisodeNumber = 1→ Always hardcoded to S01E01, regardless of where the show actually is.title = ""andepisodeOverview = ""→ No meaningful metadata.
Why this causes problems:
- The
firstAiredis set tonowUtc()(the moment of loading), so the synthetic episode might pass the future filter once but will immediately become stale. It has no real air date data. - If the watchlisted show already has episode data in the local DB (from browsing the show detail page), WatchlistAppender skips it entirely (line 27:
filter { it.traktId !in existingShowIds }), but those real episodes may not include future episodes since they are not synced for non-tracked shows. - The CalendarFutureFilter filter checks
episode.seasonNumber != 0(line 22) — this passes since the hardcoded season is 1, but the synthetic data has no real correspondence to an actual upcoming episode.
In short: Watchlist shows lack proper episode sync, and the WatchlistAppender workaround creates fake placeholder episodes with incorrect/insufficient metadata that don't reliably appear in the upcoming view.
Expected behavior
When a show is added to the Watchlist:
- Its actual upcoming episodes (with real air dates from Trakt/TMDB) should be fetched/synced.
- These upcoming episodes should appear in the Calendar → Upcoming view alongside tracked shows.
- Episodes should display proper titles, season/episode numbers, and air dates.
Steps to reproduce
- Open the app and navigate to the Discover/Search section.
- Find a TV show that has upcoming (future) episodes scheduled.
- Add the show to your Watchlist (do NOT add it to "My Shows"/tracked shows).
- Navigate to the Progress tab → Calendar → Upcoming filter.
- Observe: The watchlisted show's upcoming episodes do not appear, or appear briefly with blank titles and immediately vanish.
Suggested Fix
The WatchlistAppender needs to be reworked to either:
- Fetch real episode data for watchlisted shows from the API (Trakt) and store it locally, similar to how "My Shows" episodes are synced. Then the calendar pipeline will naturally include them.
- At minimum, use the show's
firstAiredfield instead ofnowUtc()for the synthetic episode's air date, and populate meaningful metadata (show title, proper season info from the API).
Relevant files:
ui-progress/.../calendar/helpers/WatchlistAppender.ktui-progress/.../calendar/cases/items/CalendarItemsCase.ktui-progress/.../calendar/helpers/filters/CalendarFutureFilter.ktui-progress/.../calendar/cases/items/CalendarFutureCase.kt