fix search
This commit is contained in:
parent
8527637385
commit
a5cd776874
2 changed files with 5 additions and 2 deletions
|
@ -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,
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue