From 192d0c489bb7395bfcf888e100c12c6a322349d0 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Tue, 31 Mar 2026 16:45:10 -0400 Subject: [PATCH] [widgets] Add tasks --- vrobbler/apps/scrobbles/urls.py | 5 +++++ vrobbler/apps/scrobbles/views.py | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/vrobbler/apps/scrobbles/urls.py b/vrobbler/apps/scrobbles/urls.py index 49aa73a..42dbd8f 100644 --- a/vrobbler/apps/scrobbles/urls.py +++ b/vrobbler/apps/scrobbles/urls.py @@ -32,6 +32,11 @@ urlpatterns = [ views.EmbeddableTopFoodsWidget.as_view(), name="embeddable-top-foods", ), + path( + "widget/top-tasks///", + views.EmbeddableTopTasksWidget.as_view(), + name="embeddable-top-tasks", + ), path( "manual/lookup/", views.ManualScrobbleView.as_view(), diff --git a/vrobbler/apps/scrobbles/views.py b/vrobbler/apps/scrobbles/views.py index 79e9610..787c353 100644 --- a/vrobbler/apps/scrobbles/views.py +++ b/vrobbler/apps/scrobbles/views.py @@ -1224,3 +1224,14 @@ class EmbeddableTopFoodsWidget(BaseEmbeddableWidget): from foods.models import Food return super().get_items(user, start_date, Food) + + +class EmbeddableTopTasksWidget(BaseEmbeddableWidget): + media_type = "Tasks" + count_label = "sessions" + no_data_message = "No tasks logged" + + def get_items(self, user, start_date): + from tasks.models import Task + + return super().get_items(user, start_date, Task)