fix podcasts

This commit is contained in:
bkfox 2024-04-30 21:47:07 +02:00
parent 1344e2dce1
commit 31e22beaab
3 changed files with 5 additions and 5 deletions

View File

@ -16,7 +16,7 @@ __all__ = ("Episode",)
class EpisodeQuerySet(ProgramChildQuerySet):
def with_podcasts(self):
return self.filter(episodesound__sound__is_public=True).distinct()
return self.filter(episodesound__sound__is_public=True, episodesound__sound__is_removed=False).distinct()
class Episode(ChildPage):
@ -37,7 +37,7 @@ class Episode(ChildPage):
@cached_property
def podcasts(self):
"""Return serialized data about podcasts."""
query = self.episodesound_set.all().public().order_by("-broadcast", "position")
query = self.episodesound_set.available().public().order_by("-broadcast", "position")
return self._to_podcasts(query)
@cached_property

View File

@ -58,7 +58,7 @@
{% block actions %}
{{ block.super }}
{% if object.sound_set.count %}
{% if object.episodesound_set.available.public.count %}
<button class="button action" @click="player.playButtonClick($event)"
data-sounds="{{ object.podcasts|json }}">
<span class="icon is-small">

View File

@ -126,8 +126,8 @@ class LogListAPIView(LogListMixin, BaseAPIView, ListAPIView):
self.min_date = tz.now() - tz.timedelta(minutes=30)
return date
def get_object_list(self, logs, full):
return [LogInfo(obj) for obj in super().get_object_list(logs, full)]
def get_object_list(self, logs, *args, **kwargs):
return [LogInfo(obj) for obj in super().get_object_list(logs, *args, **kwargs)]
def get_serializer(self, queryset, *args, **kwargs):
full = bool(self.request.GET.get("full"))