From 509208e3055db71d4a734856b56e02a1759d32c0 Mon Sep 17 00:00:00 2001 From: Colin Date: Tue, 22 Jul 2025 22:51:40 +0000 Subject: [PATCH] sane-bt-search: better --h265 filtering --- pkgs/by-name/sane-scripts/src/sane-bt-search | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/sane-scripts/src/sane-bt-search b/pkgs/by-name/sane-scripts/src/sane-bt-search index 7851b41ca..518e2aa7e 100755 --- a/pkgs/by-name/sane-scripts/src/sane-bt-search +++ b/pkgs/by-name/sane-scripts/src/sane-bt-search @@ -166,6 +166,14 @@ def is_cat(cats: list[str], wanted_cats: list[str], default: bool = False) -> bo else: return any(c in wanted_cats for c in cats) +H265_MARKERS = { + "h265" + "h.265" + "x265" + "x.265" + "hevc" +} + class Filter: def __init__(self, book: bool=False, h265: bool=False, manga: bool=False, video: bool=False): self.book = book @@ -186,10 +194,7 @@ class Filter: @staticmethod def is_h265(t: 'Torrent') -> bool: - meta = t.title.lower() - return "h265" in meta \ - or "x265" in meta \ - or "HEVC" in meta + return any(tag.upper() in t.title.upper() for tag in H265_MARKERS) @staticmethod def is_book(t: 'Torrent', default: bool = False) -> bool: