Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update remove_slow.py. Fixes #36 #37

Closed
wants to merge 8 commits into from
Closed

Update remove_slow.py. Fixes #36 #37

wants to merge 8 commits into from

Conversation

TheNetworkGuy
Copy link
Contributor

Slow downloads check will only run with torrent type entries. Usenet entries will be skipped.

ManiMatter and others added 4 commits February 18, 2024 22:11
Test-merge to see if versions work
Added BETA support for Readarr && removed 'Unknown Manifest' Problem (which removes ARM + x86 support) -> PRs to fix it apprecaited
Slow downloads check will only run with torrent type entries. Usenet entries will be skipped.
@TheNetworkGuy
Copy link
Contributor Author

Just a quick thought: you could also fix this globally by implementing the check in the get_queue() function under shared.py. However i will leave it up to you on which level you would want to skip usenet based downloads.

@ManiMatter
Copy link
Owner

ManiMatter commented Feb 20, 2024

Thought:
Can this be instead changed?
From
async def getDownloadedSize(settings_dict, queueItem, download_sizes_tracker):
# Determines the speed of download
# Since Sonarr/Radarr do not update the downlodedSize on realtime, if possible, fetch it directly from qBit
if settings_dict['QBITTORRENT_URL']:
qbitInfo = await rest_get(settings_dict['QBITTORRENT_URL']+'/torrents/info',params={'hashes': queueItem['downloadId']}, cookies=settings_dict['QBIT_COOKIE'] )
downloadedSize = qbitInfo[0]['completed']
else:
logger.debug('getDownloadedSize/WARN: Using imprecise method to determine download increments because no direct qBIT query is possible')
downloadedSize = queueItem['size'] - queueItem['sizeleft']

To
if settings_dict['QBITTORRENT_URL'] and queueItem['downloadClient'] == ' qbittorrent '

Then the slow check would still work for all doenload types but only torrents would be checked against qbit (snd only if thats the torrent client) else vs arr-queue status directly (which is less frequently updated)

(Untested- just pseudocode written from my phone 😄)

@TheNetworkGuy
Copy link
Contributor Author

Yes this seems to work as well! I'll modify my request.

[DEBUG]: getDownloadedSize/WARN: Using imprecise method to determine download increments because no direct qBIT query is possible

Moved qBittorrent / torrent check from remove_slow() function to getDownloadedSize()
@TheNetworkGuy
Copy link
Contributor Author

Just updated the code, validated on my own setup, moved the check to the getDownloadedSize() function and seems to work!

@ManiMatter ManiMatter changed the base branch from main to dev February 20, 2024 15:36
@ManiMatter ManiMatter self-requested a review February 20, 2024 17:38
@ManiMatter
Copy link
Owner

hi, I changed the target branch to "dev", so we can build it there first. Above says there are conflicts, and I don't seem able to resolve it (guess cause the branch is in your git profile) -> can you please have a look? once resolved, will merge to dev and then you can pull & test

@ManiMatter ManiMatter removed their request for review February 20, 2024 17:40
@TheNetworkGuy
Copy link
Contributor Author

The conflict is because you previously placed the content of the function getDownloadedSize inside of a try / except block. I forked main which does not have this change. You can either approve the merge and get rid of the try / except block (like it is in main as well) or i can add the try / except block to my code.

My preference would be to go for the first option since we eventually want to merge this to main which does not have a try / except block (was placed there for troubleshooting.)

@ManiMatter
Copy link
Owner

Pls add it as in dev so in case of future probs it works and we can try the dev image

Added try / except block in function getDownloadedSize()
Added NAME variable to function.
Removed redundant space
@TheNetworkGuy
Copy link
Contributor Author

Seems good to me now. No idea why the return statement is acting funny but its the exact same.

@ManiMatter
Copy link
Owner

ManiMatter commented Feb 20, 2024

Mh. Still can’t merge…Do you want to simply quickly fork from dev; copy the new code snd create another pr back to dev snd close this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants