From 2482e252fcc24baf1d1b321a7fcef5bcbd72e0a0 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 16 Jul 2024 01:38:30 -0400 Subject: [PATCH] show season additional_title if helpful --- catalog/templates/tvseason.html | 1 + catalog/tv/models.py | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/catalog/templates/tvseason.html b/catalog/templates/tvseason.html index 2dfa396d..692a2e5f 100644 --- a/catalog/templates/tvseason.html +++ b/catalog/templates/tvseason.html @@ -8,6 +8,7 @@ {% load thumb %} {% block details %} +
{% include '_people.html' with people=item.additional_title role='' max=99 %}
{% with item.all_seasons as seasons %} {% if seasons %}
diff --git a/catalog/tv/models.py b/catalog/tv/models.py index 27633a9a..8dc8104f 100644 --- a/catalog/tv/models.py +++ b/catalog/tv/models.py @@ -423,6 +423,16 @@ def display_title(self): return f"{self.parent_item.display_title} {s}" return s + @cached_property + def additional_title(self) -> list[str]: + title = self.display_title + return [ + t["text"] + for t in self.localized_title + if t["text"] != title + and RE_LOCALIZED_SEASON_NUMBERS.sub("", t["text"]) != "" + ] + def update_linked_items_from_external_resource(self, resource): for w in resource.required_resources: if w["model"] == "TVShow":