Skip to content

Commit

Permalink
Merge pull request #99 from phyzical/feature/support-no-file-for-import
Browse files Browse the repository at this point in the history
Update remove_missing_files.py
  • Loading branch information
ManiMatter authored May 12, 2024
2 parents d34a1c5 + 0687420 commit 5b3f3b0
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/jobs/remove_missing_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,19 @@ async def remove_missing_files(settingsDict, BASE_URL, API_KEY, NAME, deleted_do
# Find items affected
affectedItems = []
for queueItem in queue['records']:
if 'errorMessage' in queueItem and 'status' in queueItem:
if (queueItem['status'] == 'warning' and
(queueItem['errorMessage'] == 'DownloadClientQbittorrentTorrentStateMissingFiles' or
if 'status' in queueItem:
# case to check for failed torrents
if (queueItem['status'] == 'warning' and 'errorMessage' in queueItem and
(queueItem['errorMessage'] == 'DownloadClientQbittorrentTorrentStateMissingFiles' or
queueItem['errorMessage'] == 'The download is missing files')):
affectedItems.append(queueItem)
# case to check for failed nzb's/bad files/empty directory
if queueItem['status'] == 'completed' and 'statusMessages' in queueItem:
for statusMessage in queueItem['statusMessages']:
if 'messages' in statusMessage:
for message in statusMessage['messages']:
if message.startswith("No files found are eligible for import in"):
affectedItems.append(queueItem)
affectedItems = await execute_checks(settingsDict, affectedItems, failType, BASE_URL, API_KEY, NAME, deleted_downloads, defective_tracker, privateDowloadIDs, protectedDownloadIDs,
addToBlocklist = False,
doPrivateTrackerCheck = True,
Expand All @@ -26,4 +34,4 @@ async def remove_missing_files(settingsDict, BASE_URL, API_KEY, NAME, deleted_do
return len(affectedItems)
except Exception as error:
errorDetails(NAME, error)
return 0
return 0

0 comments on commit 5b3f3b0

Please sign in to comment.