From bc272fb06cb93cb368b1b0a77b4c39f7cf7f7885 Mon Sep 17 00:00:00 2001 From: Jigsaw Date: Fri, 10 Jan 2025 14:29:46 +0000 Subject: [PATCH] do not show episide comment deault --- catalog/templates/_item_comments.html | 3 ++- catalog/templates/_item_comments_by_episode.html | 2 +- catalog/views.py | 5 ++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/catalog/templates/_item_comments.html b/catalog/templates/_item_comments.html index 60a0f198..1aaba751 100644 --- a/catalog/templates/_item_comments.html +++ b/catalog/templates/_item_comments.html @@ -4,10 +4,11 @@ {% load mastodon %} {% load duration %} {% load user_actions %} +{% load comment_item %} {% if item.class_name == "tvseason" and not request.GET.last %} {% if item.all_episodes %}
- {% trans "all" %} + {% trans "season" %} {% for ep in item.all_episodes %} {% trans "all" %} + hx-target="#comments">{% trans "season" %} {% for ep in item.all_episodes %} diff --git a/catalog/views.py b/catalog/views.py index 54bb61d7..6b21a24e 100644 --- a/catalog/views.py +++ b/catalog/views.py @@ -189,7 +189,10 @@ def review_list(request, item_path, item_uuid): def comments(request, item_path, item_uuid): item = get_object_or_404(Item, uid=get_uuid_or_404(item_uuid)) - ids = item.child_item_ids + [item.pk] + item.sibling_item_ids + if item.class_name == "tvseason": + ids = [item.pk] + else: + ids = item.child_item_ids + [item.pk] + item.sibling_item_ids queryset = Comment.objects.filter(item_id__in=ids).order_by("-created_time") queryset = queryset.filter(q_piece_visible_to_user(request.user)) before_time = request.GET.get("last")