From 6fb6093fe1f57e9ead713e1e63031656a189e85f Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Mon, 13 Mar 2023 18:48:06 -0400 Subject: [PATCH] Few quick fixes --- vrobbler/apps/scrobbles/utils.py | 2 +- vrobbler/templates/scrobbles/long_plays_in_progress.html | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/vrobbler/apps/scrobbles/utils.py b/vrobbler/apps/scrobbles/utils.py index f2ba9f2..e947979 100644 --- a/vrobbler/apps/scrobbles/utils.py +++ b/vrobbler/apps/scrobbles/utils.py @@ -131,7 +131,7 @@ def get_long_plays_in_progress(user: User) -> dict: now = now_user_timezone(user.profile) for app, model in LONG_PLAY_MEDIA.items(): media_obj = apps.get_model(app_label=app, model_name=model) - for media in media_obj.objects.all().order_by("-scrobble__timestamp"): + for media in media_obj.objects.all(): last_scrobble = media.scrobble_set.filter(user=user).last() if last_scrobble and last_scrobble.long_play_complete == False: days_past = (now - last_scrobble.timestamp).days diff --git a/vrobbler/templates/scrobbles/long_plays_in_progress.html b/vrobbler/templates/scrobbles/long_plays_in_progress.html index b44c6bf..ce276e6 100644 --- a/vrobbler/templates/scrobbles/long_plays_in_progress.html +++ b/vrobbler/templates/scrobbles/long_plays_in_progress.html @@ -16,6 +16,7 @@ {% if view == 'grid' %} {% for period, medias in in_progress.items %} + {% if medias %}

{% if period == "active" %}Recently played{% else %}More than a week ago{% endif %}

{% for media in medias %} @@ -33,6 +34,7 @@ {% endfor %}
+ {% endif %} {% endfor %} {% else %}