Skip to content

Commit

Permalink
custom_format_unmet_check adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
Feramance committed Aug 30, 2024
1 parent 8b71660 commit 4f3fbb5
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions qBitrr/arss.py
Original file line number Diff line number Diff line change
Expand Up @@ -4472,9 +4472,6 @@ def custom_format_unmet_check(self, torrent: qbittorrentapi.TorrentDictionary) -
),
None,
)
series = self.series_file_model.get_or_none(
self.series_file_model.EntryId == entry
)
if self.force_minimum_custom_format:
cfunmet = customFormat < episode.MinCustomFormatScore
else:
Expand All @@ -4484,25 +4481,31 @@ def custom_format_unmet_check(self, torrent: qbittorrentapi.TorrentDictionary) -
else:
return False
elif self.type == "radarr":
entry = next(
(
record["movieId"]
for record in queue["records"]
if record["downloadId"] == torrent.hash
),
None,
)
entry = filter(lambda x: x["downloadId"] == torrent.hash, queue["records"])
# entry = next(
# (
# record["movieId"]
# for record in queue["records"]
# if record["downloadId"] == torrent.hash
# ),
# None,
# )
if not entry:
return False
else:
entry = entry["movieId"]
self.logger.debug("custom_format_unmet_check: [entry:%s]", entry)
customFormat = next(
(
record["customFormatScore"]
for record in queue["records"]
if record["downloadId"] == torrent.hash
),
None,
)
customFormat = filter(
lambda x: x["downloadId"] == torrent.hash, queue["records"]
)["customFormatScore"]
# customFormat = next(
# (
# record["customFormatScore"]
# for record in queue["records"]
# if record["downloadId"] == torrent.hash
# ),
# None,
# )
self.logger.debug("custom_format_unmet_check: [customFormat:%s]", customFormat)
movie = self.model_file.get_or_none(self.model_file.EntryId == entry)
if movie.MovieFileId != 0:
Expand Down

0 comments on commit 4f3fbb5

Please sign in to comment.