Skip to content

Commit

Permalink
Adjustmenets for re-searching stalled torrents
Browse files Browse the repository at this point in the history
  • Loading branch information
Feramance committed Jul 4, 2024
1 parent 2b921a9 commit 6f3824f
Showing 1 changed file with 17 additions and 21 deletions.
38 changes: 17 additions & 21 deletions qBitrr/arss.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,28 +850,21 @@ def _process_imports(self) -> None:
self.import_torrents.clear()

def _process_failed_individual(
self, hash_: str, entry: int, skip_blacklist: set[str], stalled: bool = False
self, hash_: str, entry: int, skip_blacklist: set[str], remove_from_client: bool = True
) -> None:
if not stalled:
if hash_ not in skip_blacklist:
self.logger.debug(
"Blocklisting: %s (%s)",
hash_,
self.manager.qbit_manager.name_cache.get(hash_, "Deleted"),
)
self.delete_from_queue(id_=entry, blacklist=True)
else:
self.delete_from_queue(id_=entry, blacklist=False)
if hash_ not in skip_blacklist:
self.logger.debug(
"Blocklisting: %s (%s)",
hash_,
self.manager.qbit_manager.name_cache.get(hash_, "Blocklisted"),
)
self.delete_from_queue(
id_=entry, remove_from_client=remove_from_client, blacklist=True
)
else:
if hash_ not in skip_blacklist:
self.logger.debug(
"Blocklisting: %s (%s)",
hash_,
self.manager.qbit_manager.name_cache.get(hash_, "Blocklisted"),
)
self.delete_from_queue(id_=entry, remove_from_client=False, blacklist=True)
else:
self.delete_from_queue(id_=entry, remove_from_client=False, blacklist=False)
self.delete_from_queue(
id_=entry, remove_from_client=remove_from_client, blacklist=False
)
if hash_ in self.recently_queue:
del self.recently_queue[hash_]
object_id = self.requeue_cache.get(entry)
Expand Down Expand Up @@ -4042,7 +4035,10 @@ def _stalled_check(self, torrent: qbittorrentapi.TorrentDictionary, time_now: fl
if payload:
for entry, hash_ in payload:
self._process_failed_individual(
hash_=hash_, entry=entry, skip_blacklist=set(), stalled=True
hash_=hash_,
entry=entry,
skip_blacklist=set[str],
remove_from_client=False,
)
else:
self.logger.trace(
Expand Down

0 comments on commit 6f3824f

Please sign in to comment.