mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
add docs for playlist endpoints
+ limit recently added tracks to 100
This commit is contained in:
committed by
Mungai Njoroge
parent
4edb3a5e7a
commit
ae031014a9
@@ -12,7 +12,7 @@ from app.serializers.artist import serialize_for_card
|
||||
|
||||
from itertools import groupby
|
||||
|
||||
from app.utils.dates import timestamp_from_days_ago, timestamp_to_time_passed
|
||||
from app.utils.dates import timestamp_to_time_passed
|
||||
|
||||
older_albums = set()
|
||||
older_artists = set()
|
||||
@@ -216,8 +216,6 @@ def get_recent_items(limit: int = 7):
|
||||
return recent_items
|
||||
|
||||
|
||||
def get_recent_tracks(cutoff_days: int):
|
||||
def get_recent_tracks(limit: int):
|
||||
tracks = sorted(TrackStore.tracks, key=lambda t: t.created_date, reverse=True)
|
||||
timestamp = timestamp_from_days_ago(cutoff_days)
|
||||
|
||||
return [t for t in tracks if t.created_date > timestamp]
|
||||
return tracks[:limit]
|
||||
Reference in New Issue
Block a user