Fixed tracker resetting logic when queue is empty

This commit is contained in:
Benjamin Harder
2025-05-29 21:30:35 +02:00
parent bd97e7f8f6
commit 81d0f38895
5 changed files with 28 additions and 26 deletions

View File

@@ -22,6 +22,17 @@ class Tracker:
self.deleted = []
self.extension_checked = []
def reset(self) -> None:
for attr in (
self.protected,
self.private,
self.defective,
self.download_progress,
self.deleted,
self.extension_checked,
):
attr.clear()
async def refresh_private_and_protected(self, settings):
protected_downloads = []
private_downloads = []
@@ -65,7 +76,7 @@ class Instances:
"detail_item_id_key",
"detail_item_ids_key",
"detail_item_search_command",
}
}
outputs = []
for arr_type in ["sonarr", "radarr", "readarr", "lidarr", "whisparr"]:
@@ -151,8 +162,8 @@ class ArrInstance:
self.detail_item_key = getattr(DetailItemKey, arr_type)
self.detail_item_id_key = self.detail_item_key + "Id"
self.detail_item_ids_key = self.detail_item_key + "Ids"
self.detail_item_search_command = getattr(DetailItemSearchCommand, arr_type)
self.detail_item_search_command = getattr(DetailItemSearchCommand, arr_type)
async def _check_ui_language(self):
"""Check if the UI language is set to English."""
endpoint = self.api_url + "/config/ui"