From dca66003fd8cec9c8011752fc95393ea9e8f1a71 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Thu, 4 May 2023 09:55:35 -0400 Subject: [PATCH] Limit imports to last 10 --- vrobbler/apps/scrobbles/views.py | 6 +++--- vrobbler/templates/scrobbles/import_list.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vrobbler/apps/scrobbles/views.py b/vrobbler/apps/scrobbles/views.py index 3e72710..a9f52be 100644 --- a/vrobbler/apps/scrobbles/views.py +++ b/vrobbler/apps/scrobbles/views.py @@ -160,13 +160,13 @@ class ScrobbleImportListView(TemplateView): context_data["tsv_imports"] = AudioScrobblerTSVImport.objects.filter( user=self.request.user, - ).order_by("-processing_started") + ).order_by("-processing_started")[:10] context_data["koreader_imports"] = KoReaderImport.objects.filter( user=self.request.user, - ).order_by("-processing_started") + ).order_by("-processing_started")[:10] context_data["lastfm_imports"] = LastFmImport.objects.filter( user=self.request.user, - ).order_by("-processing_started") + ).order_by("-processing_started")[:10] return context_data diff --git a/vrobbler/templates/scrobbles/import_list.html b/vrobbler/templates/scrobbles/import_list.html index 8a79697..e46ca77 100644 --- a/vrobbler/templates/scrobbles/import_list.html +++ b/vrobbler/templates/scrobbles/import_list.html @@ -1,6 +1,6 @@ {% extends "base_list.html" %} -{% block title %}Scrobble Imports{% endblock %} +{% block title %}Last 10 scrobble imports by source{% endblock %} {% block lists %} {% if tsv_imports %}