Skip to content

Commit

Permalink
Torrent pausing functionality changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Feramance committed Jan 10, 2024
1 parent d5249dd commit f7ea7c4
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions qBitrr/arss.py
Original file line number Diff line number Diff line change
Expand Up @@ -1995,8 +1995,6 @@ def db_update_single_series(
request: bool = False,
series: bool = False,
):
minCustomFormat = 0
customFormat = 0
if self.search_missing is False:
return
try:
Expand Down Expand Up @@ -2215,13 +2213,15 @@ def db_update_single_series(
try:
completed = False
movieData = self.client.get_movie(db_entry["id"])
minCustomFormat = self.client.get_quality_profile(
movieData["qualityProfileId"]
)["minFormatScore"]
if db_entry["hasFile"]:
minCustomFormat = self.client.get_quality_profile(
movieData["qualityProfileId"]
)["minFormatScore"]
customFormat = self.client.get_movie_file(
movieData["movieFile"]["id"]
)["customFormatScore"]
else:
customFormat = 0
except (
requests.exceptions.ChunkedEncodingError,
requests.exceptions.ContentDecodingError,
Expand Down Expand Up @@ -2849,7 +2849,7 @@ def _process_single_torrent_queued_upload(
torrent.name,
torrent.hash,
)
else:
elif "qBitrr-allowed_seeding" not in torrent.tags:
self.pause.add(torrent.hash)
self.logger.trace(
"Pausing torrent: Queued Upload | "
Expand Down Expand Up @@ -3034,7 +3034,7 @@ def _process_single_torrent_fully_completed_torrent(
torrent.name,
torrent.hash,
)
else:
elif "qBitrr-allowed_seeding" not in torrent.tags:
self.logger.info(
"Pausing Completed torrent: "
"[Progress: %s%%][Added On: %s]"
Expand Down Expand Up @@ -3104,7 +3104,7 @@ def _process_single_torrent_uploading(
torrent.name,
torrent.hash,
)
else:
elif "qBitrr-allowed_seeding" not in torrent.tags:
self.logger.info(
"Pausing uploading torrent: "
"[Progress: %s%%][Added On: %s]"
Expand Down Expand Up @@ -3394,8 +3394,8 @@ def _should_leave_alone(
return_value = True
if return_value and "qBitrr-allowed_seeding" not in torrent.tags:
torrent.add_tags(tags=["qBitrr-allowed_seeding"])
elif not return_value and "qBitrr-allowed_seeding" in torrent.tags:
torrent.remove_tags(tags=["qBitrr-allowed_seeding"])
# elif not return_value and "qBitrr-allowed_seeding" in torrent.tags:
# torrent.remove_tags(tags=["qBitrr-allowed_seeding"])
return (
return_value,
data_settings.get("max_eta", self.maximum_eta),
Expand Down Expand Up @@ -3638,15 +3638,15 @@ def _process_single_torrent(self, torrent: qbittorrentapi.TorrentDictionary):
elif torrent.state_enum == TorrentStates.MISSING_FILES:
self._process_single_torrent_missing_files(torrent)
# If a torrent is Uploading Pause it, as long as its not being Forced Uploaded.
# elif (
# self.is_uploading_state(torrent)
# and torrent.seeding_time > 1
# and torrent.amount_left == 0
# and torrent.added_on > 0
# and torrent.content_path
# and self.seeding_mode_global_remove_torrent != -1
# ) and torrent.hash in self.cleaned_torrents:
# self._process_single_torrent_uploading(torrent, leave_alone)
elif (
self.is_uploading_state(torrent)
and torrent.seeding_time > 1
and torrent.amount_left == 0
and torrent.added_on > 0
and torrent.content_path
and self.seeding_mode_global_remove_torrent != -1
) and torrent.hash in self.cleaned_torrents:
self._process_single_torrent_uploading(torrent, leave_alone)
# Mark a torrent for deletion
elif (
torrent.state_enum != TorrentStates.PAUSED_DOWNLOAD
Expand Down

0 comments on commit f7ea7c4

Please sign in to comment.