fix search

This commit is contained in:
Your Name 2024-07-18 14:57:35 -04:00 committed by Henri Dickson
parent 8527637385
commit a5cd776874
2 changed files with 5 additions and 2 deletions

View file

@ -100,7 +100,6 @@ def search(request):
keywords = request.GET.get("q", default="").strip()
if re.match(r"^[@]", keywords):
return query_identity(request, keywords.replace("", "@"))
keywords = re.sub(r"[^\w-]+", " ", keywords)
category = request.GET.get("c", default="all").strip().lower()
hide_category = False
if category == "all" or not category:
@ -138,6 +137,7 @@ def search(request):
if request.GET.get("r"):
return redirect(keywords)
keywords = re.sub(r"[^\w-]+", " ", keywords)
items, num_pages, __, dup_items = query_index(keywords, categories, tag, p)
return render(
request,

View file

@ -409,7 +409,10 @@ class TVSeason(Item):
- "Show Title Season X" with some localization
"""
s = super().display_title
if RE_LOCALIZED_SEASON_NUMBERS.sub("", s) == "" and self.parent_item:
if self.parent_item and (
RE_LOCALIZED_SEASON_NUMBERS.sub("", s) == ""
or s == self.parent_item.display_title
):
if self.parent_item.get_season_count() == 1:
return self.parent_item.display_title
elif self.season_number: