improve title filtering and tv shows results

This commit is contained in:
Dariush
2024-11-15 17:45:04 +01:00
parent cdf1666911
commit ac9b48ef92
2 changed files with 8 additions and 1 deletions
+2
View File
@@ -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(
+6 -1
View File
@@ -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