Add watchlist source name override for ani-cli queries

This commit is contained in:
Dymas
2026-06-13 16:52:11 +02:00
parent ef00ff20a9
commit 6403c98b7d
7 changed files with 70 additions and 21 deletions
+15 -7
View File
@@ -1598,6 +1598,7 @@ class WatchlistCompletionTests(unittest.TestCase):
"show_id": "show-42",
"title": "Queue Show",
"auto_download_name": "Queue Show Library",
"auto_download_source_name": "Queue Show Source",
"auto_download_series": "4",
"auto_download_quality": "720",
"media_type": "movie",
@@ -1613,7 +1614,7 @@ class WatchlistCompletionTests(unittest.TestCase):
runtime["download_queue"].add.assert_called_once_with(
{
"show_id": "show-42",
"query": "Queue Show",
"query": "Queue Show Source",
"title": "Queue Show",
"anime_name": "Queue Show Library",
"media_type": "movie",
@@ -1656,6 +1657,7 @@ class WatchlistCompletionTests(unittest.TestCase):
"show_id": "show-42",
"title": "Queue Show",
"auto_download_name": "Queue Show",
"auto_download_source_name": "Queue Show Alt Search",
"auto_download_series": "1",
"media_type": "tv",
}
@@ -2339,6 +2341,7 @@ class AutoDownloadQueueTests(unittest.TestCase):
"auto_download_mode": "dub",
"auto_download_quality": "best",
"auto_download_name": 'Queue Show: Alt/Name',
"auto_download_source_name": "Queue Show Source",
"auto_download_series": "3",
"auto_download_offset": "13",
"downloaded_dub_episodes": ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"],
@@ -2370,7 +2373,7 @@ class AutoDownloadQueueTests(unittest.TestCase):
download_queue.add.assert_called_once_with(
{
"show_id": "show-42",
"query": "Queue Show",
"query": "Queue Show Source",
"title": "Queue Show",
"anime_name": "Queue Show- Alt-Name",
"media_type": "tv",
@@ -2395,6 +2398,7 @@ class AutoDownloadQueueTests(unittest.TestCase):
"auto_download_mode": "dub",
"auto_download_quality": "best",
"auto_download_name": "Backlog Show",
"auto_download_source_name": "Backlog Show Search",
"auto_download_series": "1",
"auto_download_offset": None,
"downloaded_dub_episodes": [],
@@ -2424,7 +2428,7 @@ class AutoDownloadQueueTests(unittest.TestCase):
download_queue.add.assert_called_once_with(
{
"show_id": "show-99",
"query": "Backlog Show",
"query": "Backlog Show Search",
"title": "Backlog Show",
"anime_name": "Backlog Show",
"media_type": "tv",
@@ -2449,6 +2453,7 @@ class AutoDownloadQueueTests(unittest.TestCase):
"auto_download_mode": "dub",
"auto_download_quality": "best",
"auto_download_name": "First Refresh Show",
"auto_download_source_name": "First Refresh Source",
"auto_download_series": "1",
"auto_download_offset": None,
"downloaded_dub_episodes": [],
@@ -2478,7 +2483,7 @@ class AutoDownloadQueueTests(unittest.TestCase):
download_queue.add.assert_called_once_with(
{
"show_id": "show-first-refresh",
"query": "First Refresh Show",
"query": "First Refresh Source",
"title": "First Refresh Show",
"anime_name": "First Refresh Show",
"media_type": "tv",
@@ -2503,6 +2508,7 @@ class AutoDownloadQueueTests(unittest.TestCase):
"auto_download_mode": "dub",
"auto_download_quality": "best",
"auto_download_name": "Split Season Show",
"auto_download_source_name": "Split Season Search",
"auto_download_series": "2",
"auto_download_offset": "13",
"downloaded_dub_episodes": [],
@@ -2531,7 +2537,7 @@ class AutoDownloadQueueTests(unittest.TestCase):
download_queue.add.assert_called_once_with(
{
"show_id": "show-77",
"query": "Split Season Show",
"query": "Split Season Search",
"title": "Split Season Show",
"anime_name": "Split Season Show",
"media_type": "tv",
@@ -3089,7 +3095,7 @@ class HandlerRouteTests(unittest.TestCase):
self.assertEqual(handler.json_status, HTTPStatus.CREATED)
def test_watchlist_auto_download_settings_post_returns_updated_item(self):
body = b'{"show_id":"show-1","mode":"dub","quality":"best","name":"Example Name","series":"2","episode_offset":"13"}'
body = b'{"show_id":"show-1","mode":"dub","quality":"best","name":"Example Name","source_name":"Example Source","series":"2","episode_offset":"13"}'
handler = DummyHandler("/api/watchlist/update-auto-download", body=body, content_length=len(body))
payload = {"message": "Saved auto-download settings for Show 1.", "item": {"show_id": "show-1"}}
handler.handler_context = mock.Mock(update_watchlist_auto_download=mock.Mock(return_value=payload))
@@ -3097,7 +3103,7 @@ class HandlerRouteTests(unittest.TestCase):
self.assertEqual(handler.json_payload, payload)
self.assertEqual(handler.json_status, HTTPStatus.OK)
handler.handler_context.update_watchlist_auto_download.assert_called_once_with(
"show-1", "dub", "best", "Example Name", "2", "13"
"show-1", "dub", "best", "Example Name", "Example Source", "2", "13"
)
def test_watchlist_media_type_post_returns_updated_item(self):
@@ -3316,6 +3322,8 @@ class TemplateHelperTests(unittest.TestCase):
self.assertIn("closeAutoDownloadOverlay()", APP.WATCHLIST_HTML)
self.assertIn("Save auto-download", APP.WATCHLIST_HTML)
self.assertIn("Manual add does not trigger it", APP.WATCHLIST_HTML)
self.assertIn("Source name", APP.WATCHLIST_HTML)
self.assertIn('id="autoDownloadSourceName"', APP.WATCHLIST_HTML)
self.assertIn("Name source", APP.WATCHLIST_HTML)
self.assertIn('class="wide-half">Name source', APP.WATCHLIST_HTML)
self.assertIn('class="wide-half">Name', APP.WATCHLIST_HTML)