diff --git a/catalog/management/commands/discover.py b/catalog/management/commands/discover.py index d9bc0a2d..fd6ac864 100644 --- a/catalog/management/commands/discover.py +++ b/catalog/management/commands/discover.py @@ -51,7 +51,14 @@ class Command(BaseCommand): while len(item_ids) < MAX_GALLERY_ITEMS / 2 and days < 150: item_ids = self.get_popular_item_ids(category, days) days *= 3 - items = Item.objects.filter(id__in=item_ids) + items = list( + Item.objects.filter(id__in=item_ids).order_by("-created_time") + ) + if category == ItemCategory.TV: + seasons = [i for i in items if i.__class__ == TVSeason] + for season in seasons: + if season.show in items: + items.remove(season.show) gallery_list.append( { "name": "popular_" + category.value, diff --git a/catalog/templates/_item_card_metadata.html b/catalog/templates/_item_card_metadata.html index 10c5f6d3..76d6d084 100644 --- a/catalog/templates/_item_card_metadata.html +++ b/catalog/templates/_item_card_metadata.html @@ -55,6 +55,9 @@ {% if item.release_date %}{{ item.release_date }}{% endif %} {% include '_people.html' with people=item.genre role='' max=10 %} {% include '_people.html' with people=item.platform role='' max=10 %} + {% if item.show %} + {% trans '所属剧集:' %}{{ item.show.title }} + {% endif %}