From 5baf0b80aa9766ad0d9e633511f4cbe465a21f89 Mon Sep 17 00:00:00 2001 From: Deluan Date: Thu, 19 Sep 2024 08:45:49 -0400 Subject: [PATCH] fix(ui): sort playlist by song duration (#3284) --- persistence/playlist_track_repository.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/persistence/playlist_track_repository.go b/persistence/playlist_track_repository.go index f2089edcf..615366cc7 100644 --- a/persistence/playlist_track_repository.go +++ b/persistence/playlist_track_repository.go @@ -27,10 +27,11 @@ func (r *playlistRepository) Tracks(playlistId string, refreshSmartPlaylist bool p.tableName = "playlist_tracks" p.registerModel(&model.PlaylistTrack{}, nil) p.sortMappings = map[string]string{ - "id": "playlist_tracks.id", - "artist": "order_artist_name asc", - "album": "order_album_name asc, order_album_artist_name asc", - "title": "order_title", + "id": "playlist_tracks.id", + "artist": "order_artist_name asc", + "album": "order_album_name asc, order_album_artist_name asc", + "title": "order_title", + "duration": "duration", // To make sure the field will be whitelisted } if conf.Server.PreferSortTags { p.sortMappings["artist"] = "COALESCE(NULLIF(sort_artist_name,''),order_artist_name) asc"