From 33e2c4bf316dd65a42c331256747504735bc659e Mon Sep 17 00:00:00 2001 From: Keith Edmunds Date: Fri, 14 Feb 2025 19:27:47 +0000 Subject: [PATCH] Fix order of playdates on hover Fixes: #275 --- app/models.py | 4 ++-- app/playlistmodel.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models.py b/app/models.py index 49c79a3..63cc2f0 100644 --- a/app/models.py +++ b/app/models.py @@ -128,13 +128,13 @@ class Playdates(dbtables.PlaydatesTable): ) -> Sequence["Playdates"]: """ Return a list of the last limit playdates for this track, sorted - earliest to latest. + latest to earliest. """ return session.scalars( Playdates.select() .where(Playdates.track_id == track_id) - .order_by(Playdates.lastplayed.asc()) + .order_by(Playdates.lastplayed.desc()) .limit(limit) ).all() diff --git a/app/playlistmodel.py b/app/playlistmodel.py index a075a74..034c781 100644 --- a/app/playlistmodel.py +++ b/app/playlistmodel.py @@ -1559,7 +1559,7 @@ class PlaylistModel(QAbstractTableModel): "
".join( [ a.lastplayed.strftime(Config.LAST_PLAYED_TOOLTIP_DATE_FORMAT) - for a in reversed(playdates) + for a in playdates ] ) )