Skip to content

Commit

Permalink
fix: prevent results with a quality of 0 (NONE) from being set as pre…
Browse files Browse the repository at this point in the history
…ferred in duplicates for nzb

Signed-off-by: miigotu <[email protected]>
  • Loading branch information
miigotu committed Feb 1, 2024
1 parent dd03184 commit 7a43529
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions sickchill/oldbeard/nzbget.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,16 @@ def send_nzb(result: "SearchResult", proper=False) -> bool:

if result.show.quality and dupe_score:
allowed_qualities, preferred_qualities = Quality.splitQuality(result.show.quality)
if result.quality == max(preferred_qualities, default=0):
dupe_score *= 1000
elif result.quality in preferred_qualities:
dupe_score *= 800
elif result.quality == max(allowed_qualities):
dupe_score *= 500
elif result.quality in allowed_qualities:
dupe_score *= 300
if preferred_qualities:
if result.quality == max(preferred_qualities):
dupe_score *= 1000
elif result.quality in preferred_qualities:
dupe_score *= 800
elif allowed_qualities:
if result.quality == max(allowed_qualities):
dupe_score *= 500
elif result.quality in allowed_qualities:
dupe_score *= 300

elif dupe_score and dupe_score != Quality.UNKNOWN:
dupe_score *= 100
Expand Down

0 comments on commit 7a43529

Please sign in to comment.