Skip to content

Commit

Permalink
Small cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
ManiMatter committed Apr 23, 2024
1 parent a7b8713 commit 369f450
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ You can find a sample docker-compose.yml in the docker folder.
- When broken torrents are removed the files belonging to them are deleted
- Across all removal types: A new download from another source is automatically added by radarr/sonarr/lidarr/readarr (if available)
- If you use qBittorrent and none of your torrents get removed and the verbose logs tell that all torrents are protected by the NO_STALLED_REMOVAL_QBIT_TAG even if they are not, you may be using a qBittorrent version that has problems with API calls and you may want to consider switching to a different qBit image (see https://github.com/ManiMatter/decluttarr/issues/56)
- Sonarr/Radarr etc need to run in English, else torrents may not correctly be identified as stuck

## Getting started
There's two ways to run this:
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async def getProtectedAndPrivateFromQbit(settingsDict):
qbitItem['is_private'] = qbitItemProperties.get('is_private', None) # Adds the is_private flag to qbitItem info for simplified logging
if qbitItemProperties.get('is_private', False):
privateDowloadIDs.append(str.upper(qbitItem['hash']))
logger.debug('main/getProtectedAndPrivateFromQbit/qbitItems: %s', str([{"hash": str.upper(item["hash"]), "name": item["name"], "tags": item["tags"], "is_private": item.get("is_private", None)} for item in qbitItems]))
logger.debug('main/getProtectedAndPrivateFromQbit/qbitItems: %s', str([{"hash": str.upper(item["hash"]), "name": item["name"], "category": item["category"], "tags": item["tags"], "is_private": item.get("is_private", None)} for item in qbitItems]))

logger.debug('main/getProtectedAndPrivateFromQbit/protectedDownloadIDs: %s', str(protectedDownloadIDs))
logger.debug('main/getProtectedAndPrivateFromQbit/privateDowloadIDs: %s', str(privateDowloadIDs))
Expand Down
6 changes: 3 additions & 3 deletions src/decluttarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ async def queueCleaner(settingsDict, arr_type, defective_tracker, download_sizes
if not full_queue:
logger.verbose('>>> Queue is empty.')
return
else:
logger.debug('queueCleaner/full_queue at start:')
logger.debug(full_queue)
# else:
# logger.debug('queueCleaner/full_queue at start:')
# logger.debug(full_queue)

deleted_downloads = Deleted_Downloads([])
items_detected = 0
Expand Down
6 changes: 3 additions & 3 deletions src/jobs/remove_orphans.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ async def remove_orphans(settingsDict, BASE_URL, API_KEY, NAME, deleted_download
failType = 'orphan'
full_queue = await get_queue(BASE_URL, API_KEY, params = {full_queue_param: True})
queue = await get_queue(BASE_URL, API_KEY)
logger.debug('remove_orphans/full queue IN: %s', str(full_queue))
logger.debug('remove_orphans/full queue IN: %s', formattedQueueInfo(full_queue))
if not full_queue: return 0 # By now the queue may be empty
logger.debug('remove_orphans/queue IN: %s', str(queue))
logger.debug('remove_orphans/queue IN: %s', formattedQueueInfo(queue))

# Find items affected
# 1. create a list of the "known" queue items
Expand All @@ -27,7 +27,7 @@ async def remove_orphans(settingsDict, BASE_URL, API_KEY, NAME, deleted_download
doPrivateTrackerCheck = True,
doProtectedDownloadCheck = True,
doPermittedAttemptsCheck = False)
logger.debug('remove_orphans/full queue OUT: %s', str(await get_queue(BASE_URL, API_KEY, params = {full_queue_param: True})))
logger.debug('remove_orphans/full queue OUT: %s', formattedQueueInfo(await get_queue(BASE_URL, API_KEY, params = {full_queue_param: True})))
return len(affectedItems)
except Exception as error:
errorDetails(NAME, error)
Expand Down

0 comments on commit 369f450

Please sign in to comment.