diff --git a/PROJECT.org b/PROJECT.org index 9ccade4..f2b9700 100644 --- a/PROJECT.org +++ b/PROJECT.org @@ -88,7 +88,7 @@ fetching and simple saving. *** Metadata sources **** Scraper -* Backlog [0/23] :vrobbler:project:personal: +* Backlog [1/25] :vrobbler:project:personal: ** TODO [#C] After transition to linux add curl_cffi as webpage scrapper again :webpages:metadata: ** TODO [#C] Create small utility to clean up tracks scrobbled with wonky playback times :bug:music:scrobbles: :PROPERTIES: @@ -601,6 +601,10 @@ The Edit log form should have from top to bottom: *** Description ** TODO [#A] Add trends tests for concurrent trends :trends:tests:concurrent: +** DONE [#B] Add 7-day period for trends :trends: +:PROPERTIES: +:ID: 95731744-b0ec-175e-88dc-822cf9110292 +:END: * Version 61.3 [1/1] ** DONE [#A] Add trends tests and fix fasting :trends:tests:fasting: :PROPERTIES: diff --git a/vrobbler/apps/trends/migrations/0004_alter_trendresult_period_add_last_7.py b/vrobbler/apps/trends/migrations/0004_alter_trendresult_period_add_last_7.py new file mode 100644 index 0000000..54197d4 --- /dev/null +++ b/vrobbler/apps/trends/migrations/0004_alter_trendresult_period_add_last_7.py @@ -0,0 +1,27 @@ +# Generated by Django 4.2.29 on 2026-07-19 19:39 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("trends", "0003_alter_trendresult_period"), + ] + + operations = [ + migrations.AlterField( + model_name="trendresult", + name="period", + field=models.CharField( + choices=[ + ("last_7", "Last 7 days"), + ("last_30", "Last 30 days"), + ("last_90", "Last 90 days"), + ("last_year", "Last year"), + ], + default="last_30", + max_length=20, + ), + ), + ] diff --git a/vrobbler/apps/trends/models.py b/vrobbler/apps/trends/models.py index 551f0a1..e8c30cd 100644 --- a/vrobbler/apps/trends/models.py +++ b/vrobbler/apps/trends/models.py @@ -5,6 +5,7 @@ from django_extensions.db.models import TimeStampedModel User = get_user_model() PERIOD_CHOICES = [ + ("last_7", "Last 7 days"), ("last_30", "Last 30 days"), ("last_90", "Last 90 days"), ("last_year", "Last year"), diff --git a/vrobbler/apps/trends/utils.py b/vrobbler/apps/trends/utils.py index 31f1e12..f68d4ea 100644 --- a/vrobbler/apps/trends/utils.py +++ b/vrobbler/apps/trends/utils.py @@ -8,6 +8,7 @@ from trends.trends import TREND_REGISTRY logger = logging.getLogger(__name__) PERIOD_DAYS = { + "last_7": 7, "last_30": 30, "last_90": 90, "last_year": 365,