Skip to content

Add a preference to turn off starting the next season automatically - #1802

Open
julienbeugras wants to merge 3 commits into
FuzzyGrim:devfrom
julienbeugras:auto-start-next-season-preference
Open

julienbeugras wants to merge 3 commits into
FuzzyGrim:devfrom
julienbeugras:auto-start-next-season-preference

Conversation

@julienbeugras

Copy link
Copy Markdown

Closes #1355

Completing a season marks the next released season as in progress. Users who don't start the next season right away, or who log past seasons while backfilling their history, currently have no way to turn this off.

Changes

  • New user preference Start next season automatically (User.auto_start_next_season, migration 0060), shown in Preferences between "Hide completed recommendations" and "Hide zero ratings". It defaults to on, so nothing changes for existing users.
  • When it's off, completing a season (by status or by watching its last episode) leaves later seasons untouched. The show stays in progress while a released season remains, with an info message " Season N is available to watch." in place of "…was marked as in progress automatically". The show is still completed when no released season remains.
  • Setting the whole show to In progress still starts the next season, since that is an explicit action.
  • The rule that picks the next season (app.helpers.next_released_season) is now a pure function taking the season metadata, the completed season numbers and the date. TV._find_next_available_season fetches that data, and TV._start_next_available_season uses it, so the lookup is shared by both branches and tested without mocking the provider.

With the preference off, a show can be in progress without an in-progress season. That is the same state the existing code already leaves when the next season hasn't aired yet.

Tests

  • NextReleasedSeasonTests: next season after the completed one, completed later seasons skipped, specials and earlier seasons ignored, unaired seasons and missing air dates.
  • Season and episode model tests for the preference off: next season not created, a Planning season stays Planning, an unaired next season still completes the show, the message is sent.
  • Preferences view test that the setting saves and clears.

The new model tests fail against dev. manage.py test app users integrations lists events --parallel passes, and so do ruff check src, ruff format --check src and the pre-commit hooks. Also checked by hand on a local instance with a show that has several aired seasons, with the preference on and off.

Completing a season marks the next released season as in progress. Users
who do not start the next season right away, or who log past seasons
while backfilling history, had no way to turn this off (FuzzyGrim#1355).

The new "Start next season automatically" preference defaults to on, so
nothing changes for existing users. When it is off, completing a season
leaves later seasons untouched; the show stays in progress while a
released season remains, and is still completed when none does.

Closes FuzzyGrim#1355
_find_next_available_season now returns the next released season to
watch, and _start_next_available_season uses it, so the preference check
no longer needs a flag that turns "start" into "look". When the
preference is off, completing a season now also tells the user that the
next season is available, like the other automatic status changes do.

Adds a test for completing a season by watching its last episode with
the preference off.
next_released_season picks the next season to watch from a show's season
metadata, the seasons the user completed and today's date. The TV model
fetches that data and passes it in, so the rule is tested directly
without mocking TMDB.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Disable automatic next season In Progress

1 participant