Skip to content

Commit

Permalink
Merge pull request #104 from ManiMatter/skip-slow-download-check-for-…
Browse files Browse the repository at this point in the history
…usenet

Excluding usenet downloads from slowness check
  • Loading branch information
ManiMatter authored May 13, 2024
2 parents e9c7e4d + 08327b7 commit f9dc823
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ Steers which type of cleaning is applied to the downloads queue
**REMOVE_SLOW**
- Steers whether slow downloads are removed from the queue
- Slow downloads are added to the blocklist, so that they are not re-requested in the future
- Note: Does not apply to usenet downloads (since there users pay for certain speed, slowness should not occurr)
- Type: Boolean
- Permissible Values: True, False
- Is Mandatory: No (Defaults to False)
Expand Down
2 changes: 2 additions & 0 deletions src/jobs/remove_slow.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ async def remove_slow(settingsDict, BASE_URL, API_KEY, NAME, deleted_downloads,
if 'downloadId' in queueItem and 'size' in queueItem and 'sizeleft' in queueItem and 'status' in queueItem:
if queueItem['downloadId'] not in alreadyCheckedDownloadIDs:
alreadyCheckedDownloadIDs.append(queueItem['downloadId']) # One downloadId may occur in multiple queueItems - only check once for all of them per iteration
if queueItem['usenet']: # No need to check for speed for usenet, since there users pay for speed
continue
if queueItem['sizeleft'] == 0: # Skip items that are finished downloading but are still marked as downloading. May be the case when files are moving
logger.debug('remove_slow/skipping completed item marked as downloading: %s (Speed: %d KB/s, KB now: %s, KB previous: %s, Diff: %s, In Minutes: %s', \
queueItem['title'], speed, downloadedSize, previousSize, increment, settingsDict['REMOVE_TIMER'])
Expand Down

0 comments on commit f9dc823

Please sign in to comment.