Skip to content

Commit

Permalink
Stalled updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Feramance committed Jun 30, 2024
1 parent 2ade7cb commit 520619c
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions qBitrr/arss.py
Original file line number Diff line number Diff line change
Expand Up @@ -3970,7 +3970,7 @@ def _process_single_torrent(self, torrent: qbittorrentapi.TorrentDictionary):
)
maximum_eta = _tracker_max_eta

stalled_ignore = False
stalled_ignore = True
self.logger.trace(
"Stalled check: %s [Current:%s][Added:%s][Limit:%s]",
torrent.name,
Expand All @@ -3981,15 +3981,25 @@ def _process_single_torrent(self, torrent: qbittorrentapi.TorrentDictionary):
),
)
if (
torrent.state_enum
in (
TorrentStates.METADATA_DOWNLOAD,
TorrentStates.STALLED_DOWNLOAD,
(
torrent.state_enum
in (
TorrentStates.METADATA_DOWNLOAD,
TorrentStates.STALLED_DOWNLOAD,
)
and "qBitrr-ignored" not in torrent.tags
and "qBitrr-free_space_paused" not in torrent.tags
)
or (
torrent.availability < 1
and not self.is_uploading_state(torrent)
and torrent.state_enum != TorrentStates.PAUSED_DOWNLOAD
(
self.recently_queue.get(torrent.hash, torrent.added_on)
< time_now - self.ignore_torrents_younger_than
and torrent.availability < 1
)
and torrent.hash in self.cleaned_torrents
and self.is_downloading_state(torrent)
and "qBitrr-ignored" not in torrent.tags
and "qBitrr-free_space_paused" not in torrent.tags
)
) and self.allowed_stalled:
if (
Expand All @@ -4003,24 +4013,24 @@ def _process_single_torrent(self, torrent: qbittorrentapi.TorrentDictionary):
)
elif "qBitrr-allowed_stalled" not in torrent.tags:
torrent.add_tags(["qBitrr-allowed_stalled"])
stalled_ignore = True
self.logger.trace(
"Stalled, adding tag: %s",
torrent.name,
)
elif "qBitrr-allowed_stalled" in torrent.tags:
stalled_ignore = True
self.logger.trace(
"Stalled: %s",
torrent.name,
)
elif "qBitrr-allowed_stalled" in torrent.tags:
torrent.remove_tags(["qBitrr-allowed_stalled"])
stalled_ignore = False
self.logger.trace(
"Not stalled, removing tag: %s",
torrent.name,
)
else:
stalled_ignore = False
self.logger.trace(
"Not stalled: %s",
torrent.name,
Expand Down

0 comments on commit 520619c

Please sign in to comment.