From c9f230c9cb8649dbe5f0dfab923039785b4c885b Mon Sep 17 00:00:00 2001 From: Goldy <153996346+g0ldyy@users.noreply.github.com> Date: Fri, 19 Jul 2024 23:20:51 +0200 Subject: [PATCH] fix: slightly improve anime results --- comet/api/stream.py | 4 +++- comet/utils/general.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/comet/api/stream.py b/comet/api/stream.py index 46913fc..46fdce2 100644 --- a/comet/api/stream.py +++ b/comet/api/stream.py @@ -193,10 +193,12 @@ async def stream(request: Request, b64config: str, type: str, id: str): f"Start of {indexer_manager_type} search for {log_name} with indexers {config['indexers']}" ) - search_terms = [name] if not kitsu else [f"{name} {episode}"] + search_terms = [name] if type == "series": if not kitsu: search_terms.append(f"{name} S0{season}E0{episode}") + else: + search_terms.append(f"{name} {episode}") tasks.extend( get_indexer_manager( session, indexer_manager_type, config["indexers"], term diff --git a/comet/utils/general.py b/comet/utils/general.py index b0ea0d3..f166ec2 100644 --- a/comet/utils/general.py +++ b/comet/utils/general.py @@ -321,9 +321,9 @@ async def filter(torrents: list, name: str): results = [] for torrent in torrents: index = torrent[0] - torrent = torrent[1] + title = torrent[1] - if title_match(name, parse(torrent).parsed_title): + if title_match(name, parse(title).parsed_title): results.append((index, True)) continue