Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show season additional_title if helpful #706

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions catalog/templates/tvseason.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
{% load thumb %}
<!-- class specific details -->
{% block details %}
<div>{% include '_people.html' with people=item.additional_title role='' max=99 %}</div>
{% with item.all_seasons as seasons %}
{% if seasons %}
<div>
Expand Down
10 changes: 10 additions & 0 deletions catalog/tv/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down