diff --git a/catalog/search/views.py b/catalog/search/views.py index d0db9195..592fe2b0 100644 --- a/catalog/search/views.py +++ b/catalog/search/views.py @@ -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, diff --git a/catalog/tv/models.py b/catalog/tv/models.py index 2ced702c..ce33bba4 100644 --- a/catalog/tv/models.py +++ b/catalog/tv/models.py @@ -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: