diff --git a/CHANGELOG.md b/CHANGELOG.md index dff6683..e3d01df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.40.3 - 2026-05-25 + +- Passed the Search page `Season` value into new watchlist entries so the initial auto-download series setting matches what was chosen before tracking the show. + ## 0.40.2 - 2026-05-25 - Replaced the inline `Alternative titles` expansion with a centered overlay dialog so opening AniDB title variants no longer shifts the watchlist layout. diff --git a/README.md b/README.md index f2f59e9..e23520a 100644 --- a/README.md +++ b/README.md @@ -225,6 +225,7 @@ Main behavior: 8. Pagination shows 30 cards per page. 9. `Alternative titles` opens a centered overlay with English alternate titles from AniDB when the watchlist refresh can match the show to an AniDB entry. 10. `Auto-download` opens a centered overlay with per-series settings for language, quality, series number, and the sanitized library name used for automatically queued episodes. +11. Adding a show from Search reuses the current `Season` field as the initial auto-download series value for that new watchlist entry. Status behavior: diff --git a/VERSION b/VERSION index 385bb68..e373c4a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.40.2 +0.40.3 diff --git a/app.py b/app.py index 68af747..10f1273 100644 --- a/app.py +++ b/app.py @@ -1558,6 +1558,7 @@ class WatchlistStore: "downloaded_sub_episodes_json": None, "downloaded_dub_episodes_json": None, } + item["auto_download_series"] = normalize_season(payload.get("auto_download_series") or item.get("auto_download_series") or "1") self._upsert_conn(conn, item) queued = self.schedule_refresh(show_id, source="initial") diff --git a/app_support.py b/app_support.py index 5966bd0..2b6c1db 100644 --- a/app_support.py +++ b/app_support.py @@ -19,7 +19,7 @@ from uuid import uuid4 PROJECT_ROOT = Path(__file__).resolve().parent ANI_CLI = os.environ.get("ANI_CLI_BIN") or shutil.which("ani-cli") or "ani-cli" APP_NAME = "ani-cli-web" -VERSION = "0.40.2" +VERSION = "0.40.3" ALLANIME_BASE = "allanime.day" ALLANIME_API = f"https://api.{ALLANIME_BASE}" ALLANIME_REFERER = "https://allmanga.to" diff --git a/search_page.py b/search_page.py index b9d5fe3..f7c6517 100644 --- a/search_page.py +++ b/search_page.py @@ -516,7 +516,8 @@ INDEX_HTML = r""" body: JSON.stringify({ show_id: state.selected.id, title: state.selected.title, - category: $("trackCategory").value + category: $("trackCategory").value, + auto_download_series: $("seasonInput").value || "1" }) }); setNotice(data.message || "Added to watchlist."); diff --git a/test_app.py b/test_app.py index 6217fb8..c95afb3 100644 --- a/test_app.py +++ b/test_app.py @@ -1036,6 +1036,14 @@ class WatchlistCompletionTests(unittest.TestCase): self.assertEqual(result["item"]["status"], "queued") self.assertIn("Refresh queued", result["message"]) + def test_add_uses_requested_auto_download_series(self): + with mock.patch.object(APP.WATCHLIST, "schedule_refresh", side_effect=lambda show_id, source="manual": APP.WATCHLIST.get(show_id)): + result = APP.WATCHLIST.add( + {"show_id": "show-23", "title": "Queued Show", "category": "watching", "auto_download_series": "4"} + ) + + self.assertEqual(result["item"]["auto_download_series"], "4") + def test_refresh_uses_bounded_request_timeout(self): self.seed_watchlist_item(show_id="show-1", title="Example Show") snapshot = { @@ -1951,6 +1959,9 @@ class TemplateHelperTests(unittest.TestCase): self.assertIn("async function api(path, options = {})", APP.CONFIG_HTML) self.assertIn("async function api(path, options = {})", APP.WATCHLIST_HTML) + def test_search_page_sends_watchlist_auto_download_series(self): + self.assertIn('auto_download_series: $("seasonInput").value || "1"', APP.INDEX_HTML) + def test_pages_share_serial_polling_helper(self): self.assertIn("function startSerialPoll(callback, intervalMs)", APP.QUEUE_HTML) self.assertIn("function startSerialPoll(callback, intervalMs)", APP.WATCHLIST_HTML)