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)