diff --git a/catalog/search/external.py b/catalog/search/external.py index 6b72e999..2c55d0d8 100644 --- a/catalog/search/external.py +++ b/catalog/search/external.py @@ -157,11 +157,13 @@ class TheMovieDatabase: if m["media_type"] == "tv": cat = ItemCategory.TV title = m["name"] - subtitle = f"{m.get('first_air_date')} {m.get('original_name')}" + subtitle = f"{m.get('first_air_date', '')} {m.get('original_name', '')}" else: cat = ItemCategory.Movie title = m["title"] - subtitle = f"{m.get('release_date')} {m.get('original_name')}" + subtitle = ( + f"{m.get('release_date', '')} {m.get('original_name', '')}" + ) cover = f"https://image.tmdb.org/t/p/w500/{m.get('poster_path')}" results.append( SearchResultItem( diff --git a/catalog/templates/_item_card_metadata.html b/catalog/templates/_item_card_metadata.html index 76d6d084..c425a4e9 100644 --- a/catalog/templates/_item_card_metadata.html +++ b/catalog/templates/_item_card_metadata.html @@ -33,10 +33,7 @@
- {% if item.rating %} - {{ item.rating | floatformat:1 }}分({{ item.rating_count }}人) - {% else %} - {% endif %} + {% if item.rating %}{{ item.rating | floatformat:1 }}分({{ item.rating_count }}人){% endif %} {% include '_people.html' with people=item.author role='作者' max=2 %} {% include '_people.html' with people=item.translator role='译者' max=2 %} {% include '_people.html' with people=item.director role='导演' max=2 %} diff --git a/common/templates/_header.html b/common/templates/_header.html index af67f9c7..71a538b8 100644 --- a/common/templates/_header.html +++ b/common/templates/_header.html @@ -8,11 +8,12 @@ -