-
-
Notifications
You must be signed in to change notification settings - Fork 601
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
QBT remove false link to torrent folder. #8628
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2586da1
remove false link to torrent folder.
BKSteve e3e3563
Set save folder alt
BKSteve ebf390a
some debug logging
BKSteve d1fcd43
some logging cleanup for DLS
BKSteve fa7b8f4
qbt temp folder working
BKSteve ac230fb
revert 1 info in DLS
BKSteve 9cde86b
fix a log
BKSteve e687e18
feat: add seed time, ratio, and additional trackers to qBitTorrent cl…
miigotu dbff63f
feat: show seed time option for qBitTorrent settings, label may need …
miigotu b49f6a9
chore: only send seed_time or torrent ratio to qBitTorrent if they ar…
miigotu 98e7037
Clean up qbt
BKSteve 92567bc
adjust timing, label
BKSteve 7d86a46
ratio as float
BKSteve File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
|
||
import qbittorrentapi | ||
|
||
from sickchill import settings | ||
from sickchill import logger, settings | ||
from sickchill.oldbeard.clients.generic import GenericClient | ||
|
||
if TYPE_CHECKING: # pragma: no cover | ||
|
@@ -41,20 +41,37 @@ def test_client_connection(self): | |
return True, "Success: Connected and Authenticated" | ||
|
||
@staticmethod | ||
def __torrent_args(result: "TorrentSearchResult"): | ||
def __torrent_args(result: "TorrentSearchResult") -> dict: | ||
return dict( | ||
save_path=settings.TORRENT_DIR or None, | ||
save_path=settings.TORRENT_PATH or None, | ||
download_path=settings.TORRENT_PATH_INCOMPLETE or None, | ||
category=(settings.TORRENT_LABEL, settings.TORRENT_LABEL_ANIME)[result.show.is_anime] or settings.TORRENT_LABEL, | ||
is_paused=settings.TORRENT_PAUSED, | ||
ratio_limit=(None, float(result.ratio))[float(result.ratio) > 0], | ||
seeding_time_limit=(None, 60 * int(settings.TORRENT_SEED_TIME))[int(settings.TORRENT_SEED_TIME) > 0], | ||
tags=("sickchill", "sickchill-anime")[result.show.is_anime], | ||
) | ||
|
||
def __add_trackers(self, result: "TorrentSearchResult"): | ||
if settings.TRACKERS_LIST and result.provider.public: | ||
trackers = list({x.strip() for x in settings.TRACKERS_LIST.split(",") if x.strip()}) | ||
if trackers: | ||
logger.debug(f"Adding trackers to public torrent") | ||
return self.api.torrents_add_trackers(torrent_hash=result.hash.lower(), urls=trackers) | ||
|
||
def _add_torrent_uri(self, result: "TorrentSearchResult"): | ||
return self.api.torrents_add(urls=[result.url], **self.__torrent_args(result)) | ||
logger.debug(f"Posting as url with {self.__torrent_args(result)}") | ||
action = self.api.torrents_add(urls=[result.url], **self.__torrent_args(result)) | ||
self.__add_trackers(result) | ||
return action | ||
|
||
def _add_torrent_file(self, result: "TorrentSearchResult"): | ||
return self.api.torrents_add(torrent_files=[result.content], **self.__torrent_args(result)) | ||
logger.debug(f"Posting as file with {self.__torrent_args(result)}") | ||
action = self.api.torrents_add(torrent_files=[result.content], **self.__torrent_args(result)) | ||
self.__add_trackers(result) | ||
return action | ||
|
||
def _set_torrent_priority(self, result: "TorrentSearchResult"): | ||
if not self.api.app_preferences().get("queueing_enabled"): | ||
return True | ||
return (self.api.torrents_decrease_priority, self.api.torrents_increase_priority)[result.priority == 1](result.hash.lower) | ||
return (self.api.torrents_decrease_priority, self.api.torrents_increase_priority)[result.priority == 1](result.hash.lower()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These missing parenthesis are a really old bug o can't believe I missed this all those years. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add this debug logging to others?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, this was added though when their API changes between dsm5 and 6 I think though. Up to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant add
logging.debug
for uT and rT etc. so there is some data if any of them aren't working.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By all means, if you think it might be helpful at another time for debugging go for it.