From bbb257dda87875bfcb0d236d1cd82e9a3781fdef Mon Sep 17 00:00:00 2001 From: Goldy <153996346+g0ldyy@users.noreply.github.com> Date: Thu, 4 Jul 2024 12:04:08 +0200 Subject: [PATCH] feat: add option to toggle title checking --- comet/api/stream.py | 6 ++---- comet/templates/index.html | 6 ++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/comet/api/stream.py b/comet/api/stream.py index 94d1012..5efa58b 100644 --- a/comet/api/stream.py +++ b/comet/api/stream.py @@ -170,14 +170,12 @@ async def stream(request: Request, b64config: str, type: str, id: str): object = { "Title": result["filename"], "InfoHash": result["infoHash"], - "zilean": True, } if indexer_manager_type == "prowlarr": object = { "title": result["filename"], "infoHash": result["infoHash"], - "zilean": True, } torrents.append(object) @@ -195,9 +193,9 @@ async def stream(request: Request, b64config: str, type: str, id: str): tasks = [] filtered = 0 + filter_title = config["filterTitles"] if "filterTitles" in config else True # not needed when pydantic config validation system implemented for torrent in torrents: - # Only title match check if from Zilean - if "zilean" in torrent: + if filter_title: parsed_torrent = parse( torrent["Title"] if indexer_manager_type == "jackett" diff --git a/comet/templates/index.html b/comet/templates/index.html index bcb9b5b..34f744f 100644 --- a/comet/templates/index.html +++ b/comet/templates/index.html @@ -510,6 +510,10 @@ +
+ Filter Titles +
+
Real-Debrid @@ -573,6 +577,7 @@ const languages = Array.from(document.getElementById("languages").selectedOptions).map(option => option.value); const resolutions = Array.from(document.getElementById("resolutions").selectedOptions).map(option => option.value); const maxResults = document.getElementById("maxResults").value; + const filterTitles = document.getElementById("filterTitles").checked; const selectedLanguages = languages.length === defaultLanguages.length && languages.every((val, index) => val === defaultLanguages[index]) ? ["All"] : languages; const selectedResolutions = resolutions.length === defaultResolutions.length && resolutions.every((val, index) => val === defaultResolutions[index]) ? ["All"] : resolutions; @@ -582,6 +587,7 @@ debridApiKey: debridApiKey, indexers: indexers, maxResults: parseInt(maxResults), + filterTitles: filterTitles, resolutions: selectedResolutions, languages: selectedLanguages };