From 24b5cb5fe0587cb23bd7d2ea672cf6accab4f6b2 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 4168670..517fc44 100644 --- a/app/models.py +++ b/app/models.py @@ -129,13 +129,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 53e174f..0bfba3d 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 ] ) )