Skip to content

[Bug] Shows with paused seasons stop getting reindexed — new TVDB episodes never discovered #1398

Description

@bioengineered

Summary

When a show has older seasons paused and completes all known episodes in the current season, it becomes PartiallyCompleted and stops being monitored for new TVDB episodes. New episodes added to TVDB after this point are never discovered, even though the show is still airing (tvdb_status = "Continuing").

Steps to Reproduce

  1. Add a currently-airing show (e.g. Summer House, tvdb_status=Continuing)
  2. Pause older seasons (S1-S9) — only track the current season (S10)
  3. Wait for all known episodes in S10 to complete
  4. Show state becomes PartiallyCompleted (Paused seasons + Completed season)
  5. TVDB adds new episodes (E11, E12, etc.)
  6. Riven never discovers them — no reindex is ever triggered again

Root Cause

Two interacting issues:

1. _determine_state in Show doesn't check TVDB status for the PartiallyCompleted case

The code already handles "all seasons completed but show still airing" correctly:

if all(season.state == States.Completed for season in self.seasons):
    if self.tvdb_status and self.tvdb_status.lower() in ["continuing", "upcoming"]:
        return States.Ongoing   # correctly stays Ongoing
    return States.Completed

But when any season is Paused, all(... == Completed) is False, so this check is never reached. The code falls through to:

if any(season.state in (States.Completed, States.PartiallyCompleted) ...):
    return States.PartiallyCompleted   # no TVDB status check here

2. _monitor_ongoing_schedules only monitors Ongoing/Unreleased shows

select(Show).where(Show.last_state.in_([States.Ongoing, States.Unreleased]))

PartiallyCompleted shows are excluded, so no reindex_show tasks are ever created for them.

Suggested Fix

In Show._determine_state, apply the TVDB continuing/upcoming check to the PartiallyCompleted branch as well — if any non-paused season is fully completed and the show is still airing on TVDB, it should remain Ongoing so the scheduler keeps monitoring it:

if any(season.state in (States.Completed, States.PartiallyCompleted) for season in self.seasons):
    if self.tvdb_status and self.tvdb_status.lower() in ["continuing", "upcoming"]:
        return States.Ongoing
    return States.PartiallyCompleted

Environment

  • Riven v1.0.0 (spoked/riven:dev, image built 2026-04-11)
  • PostgreSQL 17 Alpine
  • Show tested: Summer House (TVDB 321121, tvdb_status=Continuing)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions