Clear season and episode number when an episode changes series (#11) #26
Loading…
Reference in a new issue
No description provided.
Delete branch "eric/fix-11-series-change-season"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #11
Problem: assigning an episode to another series only changed
series_id. The episode kept the season and episode number from its old series until the cleanup at the next startup. Until then, Repeat Action and auto-numbering could act on the wrong data.Fix (
src/database.rs):create_series_and_assignclearsseason_idandepisode_number, since a brand-new series has no seasons.assign_seriesclears them only when the series actually changes. Picking the series the episode is already in keeps its season and number. I added that so re-selecting the same series by accident doesn't lose anything.Testing:
tests/database_tests.rsuses a real temporary SQLite database. It covers re-assigning the same series (kept), creating a new series (cleared) and moving to another existing series (cleared). It fails on master and passes with the fix.🤖 Generated with Claude Code
https://claude.ai/code/session_01E2XefpQijvBcJBfgzuaoWA