mirror of
https://github.com/g0ldyy/comet.git
synced 2026-01-12 01:16:12 +01:00
improve title filtering and tv shows results
This commit is contained in:
@@ -264,8 +264,10 @@ async def stream(request: Request, b64config: str, type: str, id: str):
|
||||
|
||||
search_terms = [name]
|
||||
if type == "series":
|
||||
search_terms = []
|
||||
if not kitsu:
|
||||
search_terms.append(f"{name} S0{season}E0{episode}")
|
||||
search_terms.append(f"{name} s0{season}e0{episode}")
|
||||
else:
|
||||
search_terms.append(f"{name} {episode}")
|
||||
tasks.extend(
|
||||
|
||||
@@ -477,7 +477,12 @@ async def filter(torrents: list, name: str, year: int):
|
||||
|
||||
parsed = parse(title)
|
||||
|
||||
if parsed.parsed_title and not title_match(name, parsed.parsed_title):
|
||||
def title_sub_match(correct_title: str, torrent_title: str):
|
||||
correct_title = correct_title.lower()
|
||||
torrent_title = torrent_title.lower()
|
||||
return correct_title in torrent_title or torrent_title in correct_title
|
||||
|
||||
if parsed.parsed_title and not (title_match(name, parsed.parsed_title) or title_sub_match(name, parsed.parsed_title)):
|
||||
results.append((index, False))
|
||||
continue
|
||||
|
||||
|
||||
Reference in New Issue
Block a user