[calendar] Fix bug in query
All checks were successful
build & deploy / test (push) Successful in 1m57s
build & deploy / build-and-deploy (push) Successful in 27s

This commit is contained in:
2026-05-27 14:46:04 -04:00
parent 72fd1ab90e
commit 2b17a92c6c

View File

@ -1368,7 +1368,7 @@ class ScrobbleCalendarView(LoginRequiredMixin, TemplateView):
.order_by("timestamp")
)
from django.db.models import Count
from django.db.models import Count, Q
from django.db.models.functions import TruncDate
total_by_day = dict(
Scrobble.objects.filter(
@ -1376,7 +1376,7 @@ class ScrobbleCalendarView(LoginRequiredMixin, TemplateView):
timestamp__date__gte=month_start,
timestamp__date__lte=month_end,
)
.exclude(media_type="GeoLocation", title__isnull=True)
.exclude(Q(media_type="GeoLocation") & Q(geo_location__title__isnull=True))
.annotate(local_date=TruncDate("timestamp", tzinfo=timezone.get_current_timezone()))
.values("local_date")
.annotate(count=Count("id"))