From 2b17a92c6c4233290b05c6ba0601c0f97af4e2bb Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Wed, 27 May 2026 14:46:04 -0400 Subject: [PATCH] [calendar] Fix bug in query --- vrobbler/apps/scrobbles/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vrobbler/apps/scrobbles/views.py b/vrobbler/apps/scrobbles/views.py index 46823de..f171b60 100644 --- a/vrobbler/apps/scrobbles/views.py +++ b/vrobbler/apps/scrobbles/views.py @@ -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"))