Pass search season into watchlist auto-download
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
# Changelog
|
# 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
|
## 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.
|
- Replaced the inline `Alternative titles` expansion with a centered overlay dialog so opening AniDB title variants no longer shifts the watchlist layout.
|
||||||
|
|||||||
@@ -225,6 +225,7 @@ Main behavior:
|
|||||||
8. Pagination shows 30 cards per page.
|
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.
|
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.
|
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:
|
Status behavior:
|
||||||
|
|
||||||
|
|||||||
@@ -1558,6 +1558,7 @@ class WatchlistStore:
|
|||||||
"downloaded_sub_episodes_json": None,
|
"downloaded_sub_episodes_json": None,
|
||||||
"downloaded_dub_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)
|
self._upsert_conn(conn, item)
|
||||||
|
|
||||||
queued = self.schedule_refresh(show_id, source="initial")
|
queued = self.schedule_refresh(show_id, source="initial")
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@ from uuid import uuid4
|
|||||||
PROJECT_ROOT = Path(__file__).resolve().parent
|
PROJECT_ROOT = Path(__file__).resolve().parent
|
||||||
ANI_CLI = os.environ.get("ANI_CLI_BIN") or shutil.which("ani-cli") or "ani-cli"
|
ANI_CLI = os.environ.get("ANI_CLI_BIN") or shutil.which("ani-cli") or "ani-cli"
|
||||||
APP_NAME = "ani-cli-web"
|
APP_NAME = "ani-cli-web"
|
||||||
VERSION = "0.40.2"
|
VERSION = "0.40.3"
|
||||||
ALLANIME_BASE = "allanime.day"
|
ALLANIME_BASE = "allanime.day"
|
||||||
ALLANIME_API = f"https://api.{ALLANIME_BASE}"
|
ALLANIME_API = f"https://api.{ALLANIME_BASE}"
|
||||||
ALLANIME_REFERER = "https://allmanga.to"
|
ALLANIME_REFERER = "https://allmanga.to"
|
||||||
|
|||||||
+2
-1
@@ -516,7 +516,8 @@ INDEX_HTML = r"""<!doctype html>
|
|||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
show_id: state.selected.id,
|
show_id: state.selected.id,
|
||||||
title: state.selected.title,
|
title: state.selected.title,
|
||||||
category: $("trackCategory").value
|
category: $("trackCategory").value,
|
||||||
|
auto_download_series: $("seasonInput").value || "1"
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
setNotice(data.message || "Added to watchlist.");
|
setNotice(data.message || "Added to watchlist.");
|
||||||
|
|||||||
+11
@@ -1036,6 +1036,14 @@ class WatchlistCompletionTests(unittest.TestCase):
|
|||||||
self.assertEqual(result["item"]["status"], "queued")
|
self.assertEqual(result["item"]["status"], "queued")
|
||||||
self.assertIn("Refresh queued", result["message"])
|
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):
|
def test_refresh_uses_bounded_request_timeout(self):
|
||||||
self.seed_watchlist_item(show_id="show-1", title="Example Show")
|
self.seed_watchlist_item(show_id="show-1", title="Example Show")
|
||||||
snapshot = {
|
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.CONFIG_HTML)
|
||||||
self.assertIn("async function api(path, options = {})", APP.WATCHLIST_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):
|
def test_pages_share_serial_polling_helper(self):
|
||||||
self.assertIn("function startSerialPoll(callback, intervalMs)", APP.QUEUE_HTML)
|
self.assertIn("function startSerialPoll(callback, intervalMs)", APP.QUEUE_HTML)
|
||||||
self.assertIn("function startSerialPoll(callback, intervalMs)", APP.WATCHLIST_HTML)
|
self.assertIn("function startSerialPoll(callback, intervalMs)", APP.WATCHLIST_HTML)
|
||||||
|
|||||||
Reference in New Issue
Block a user