Fix watchlist download sync for resolved IDs
This commit is contained in:
+15
@@ -834,6 +834,21 @@ class WatchlistCompletionTests(unittest.TestCase):
|
||||
self.assertEqual(item["finished_badge"], "downloaded")
|
||||
self.assertEqual(item["status"], "queued")
|
||||
|
||||
def test_mark_downloaded_reconciles_unique_title_match_to_new_show_id(self):
|
||||
self.seed_watchlist_item(show_id="legacy-show-9", title="Queue Show", category="watching", downloaded=False)
|
||||
|
||||
with mock.patch.object(APP.WATCHLIST, "schedule_refresh", side_effect=lambda show_id: APP.WATCHLIST.get(show_id)), mock.patch.object(
|
||||
APP.WATCHLIST, "refresh", side_effect=AssertionError("mark_downloaded should not refresh synchronously")
|
||||
):
|
||||
item = APP.WATCHLIST.mark_downloaded("resolved-show-9", title="Queue Show")
|
||||
|
||||
self.assertEqual(item["show_id"], "resolved-show-9")
|
||||
self.assertEqual(item["category"], "watching")
|
||||
self.assertTrue(item["downloaded"])
|
||||
self.assertEqual(item["status"], "queued")
|
||||
self.assertFalse(APP.WATCHLIST.has_show("legacy-show-9"))
|
||||
self.assertEqual(APP.WATCHLIST.all_show_ids(), ["resolved-show-9"])
|
||||
|
||||
def test_add_queues_refresh_without_sync_refresh(self):
|
||||
with mock.patch.object(APP.WATCHLIST, "schedule_refresh", side_effect=lambda show_id: APP.WATCHLIST.get(show_id)) as schedule_refresh, mock.patch.object(
|
||||
APP.WATCHLIST, "refresh", side_effect=AssertionError("add should not refresh synchronously")
|
||||
|
||||
Reference in New Issue
Block a user