mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-15 03:30:39 +03:00
fix(ui): sort playlist by song duration (#3284)
This commit is contained in:
parent
46be041e7b
commit
5baf0b80aa
@ -27,10 +27,11 @@ func (r *playlistRepository) Tracks(playlistId string, refreshSmartPlaylist bool
|
|||||||
p.tableName = "playlist_tracks"
|
p.tableName = "playlist_tracks"
|
||||||
p.registerModel(&model.PlaylistTrack{}, nil)
|
p.registerModel(&model.PlaylistTrack{}, nil)
|
||||||
p.sortMappings = map[string]string{
|
p.sortMappings = map[string]string{
|
||||||
"id": "playlist_tracks.id",
|
"id": "playlist_tracks.id",
|
||||||
"artist": "order_artist_name asc",
|
"artist": "order_artist_name asc",
|
||||||
"album": "order_album_name asc, order_album_artist_name asc",
|
"album": "order_album_name asc, order_album_artist_name asc",
|
||||||
"title": "order_title",
|
"title": "order_title",
|
||||||
|
"duration": "duration", // To make sure the field will be whitelisted
|
||||||
}
|
}
|
||||||
if conf.Server.PreferSortTags {
|
if conf.Server.PreferSortTags {
|
||||||
p.sortMappings["artist"] = "COALESCE(NULLIF(sort_artist_name,''),order_artist_name) asc"
|
p.sortMappings["artist"] = "COALESCE(NULLIF(sort_artist_name,''),order_artist_name) asc"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user