Added more logs to see queue items

This commit is contained in:
Benjamin Harder
2025-06-08 00:51:45 +02:00
parent 1a9f8c5e08
commit 1eacdbea26
2 changed files with 6 additions and 11 deletions

View File

@@ -8,10 +8,6 @@ class RemovalHandler:
self.job_name = job_name
async def remove_downloads(self, affected_downloads, blocklist):
logger.debug(
"removal_handler.py/remove_downloads/arr.tracker.deleted IN: %s",
str(self.arr.tracker.deleted),
)
for download_id in list(affected_downloads.keys()):
@@ -23,7 +19,7 @@ class RemovalHandler:
continue
if handling_method == "remove":
await self._remove_download(affected_download, blocklist)
await self._remove_download(affected_download, download_id, blocklist)
elif handling_method == "tag_as_obsolete":
await self._tag_as_obsolete(affected_download, download_id)
@@ -34,15 +30,11 @@ class RemovalHandler:
self.arr.tracker.deleted.append(download_id)
logger.debug(
"removal_handler.py/remove_downloads/arr.tracker.deleted OUT: %s",
str(self.arr.tracker.deleted),
)
async def _remove_download(self, affected_download, blocklist):
async def _remove_download(self, affected_download, download_id, blocklist):
queue_id = affected_download["queue_ids"][0]
logger.info(f">>> Job '{self.job_name}' triggered removal: {affected_download['title']}")
logger.debug(f"remove_handler.py/_remove_download: download_id={download_id}")
await self.arr.remove_queue_item(queue_id=queue_id, blocklist=blocklist)
async def _tag_as_obsolete(self, affected_download, download_id):

View File

@@ -30,6 +30,9 @@ class QueueManager:
elif queue_scope == "orphans":
full_queue = await self._get_queue(full_queue=True)
queue = await self._get_queue(full_queue=False)
if logger.isEnabledFor(logging.DEBUG):
logger.debug(f"queue_manager.py/get_queue_items (full) to determine orphans: Current queue ({len(full_queue)} items) = {self.format_queue(full_queue)}")
logger.debug(f"queue_manager.py/get_queue_items (normal) to determine orphans: Current queue ({len(queue)} items) = {self.format_queue(queue)}")
queue_items = [fq for fq in full_queue if fq not in queue]
elif queue_scope == "full":
queue_items = await self._get_queue(full_queue=True)