Skip to content

Commit

Permalink
Tag check changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Feramance committed Oct 28, 2024
1 parent c30e88b commit 9a43ab8
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions qBitrr/arss.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,24 +557,25 @@ def is_downloading_state(torrent: TorrentDictionary) -> bool:
def in_tags(self, torrent: TorrentDictionary, tag: str) -> bool:
return_value = False
if TAGLESS:
condition = (
self.torrents.Hash == torrent.hash & self.torrents.Category == torrent.category
)
if tag == "qBitrr-allowed_seeding":
condition &= self.torrents.AllowedSeeding is True
elif tag == "qBitrr-imported":
condition &= self.torrents.Imported is True
elif tag == "qBitrr-allowed_stalled":
condition &= self.torrents.AllowedStalled is True
elif tag == "qBitrr-free_space_paused":
condition &= self.torrents.FreeSpacePaused is True
elif tag == "qBitrr-ignored":
if tag == "qBitrr-ignored":
return_value = "qBitrr-ignored" in torrent.tags
query = self.torrents.select().where(condition).execute()
if query:
return_value = True
else:
return_value = False
condition = (
self.torrents.Hash == torrent.hash & self.torrents.Category == torrent.category
)
if tag == "qBitrr-allowed_seeding":
condition &= self.torrents.AllowedSeeding is True
elif tag == "qBitrr-imported":
condition &= self.torrents.Imported is True
elif tag == "qBitrr-allowed_stalled":
condition &= self.torrents.AllowedStalled is True
elif tag == "qBitrr-free_space_paused":
condition &= self.torrents.FreeSpacePaused is True
query = self.torrents.select().where(condition).execute()
if query:
return_value = True
else:
return_value = False
else:
if tag in torrent.tags:
return_value = True
Expand Down

0 comments on commit 9a43ab8

Please sign in to comment.