mirror of
https://github.com/navidrome/navidrome.git
synced 2026-10-28 22:27:10 +01:00
fix(jellyfin): sort playlists by name (missing Playlist sort mapping)
applySort had no sortColumnsByType entry for the Playlist type, so SortBy=SortName was ignored and the Playlists screen showed them in the repo's default order. Map SortName/Name -> name (as Subsonic does) and DateCreated -> created_at. Verified live: case-insensitive alphabetical.
This commit is contained in:
parent
0fb520f3d3
commit
f98f9380c4
2 changed files with 12 additions and 0 deletions
|
|
@ -94,6 +94,14 @@ var _ = Describe("Playlists", func() {
|
|||
Expect(q.Items[0].Name).To(Equal("Listed"))
|
||||
Expect(q.Items[0].ImageTags).To(HaveKey("Primary"))
|
||||
})
|
||||
|
||||
It("sorts playlists by name when SortBy=SortName", func() {
|
||||
createPlaylist("Charlie", nil)
|
||||
createPlaylist("Alpha", nil)
|
||||
createPlaylist("Bravo", nil)
|
||||
q := queryResult(get("/Items?IncludeItemTypes=Playlist&Recursive=true&SortBy=SortName"))
|
||||
Expect(names(q.Items)).To(Equal([]string{"Alpha", "Bravo", "Charlie"}))
|
||||
})
|
||||
})
|
||||
|
||||
Describe("cover art", func() {
|
||||
|
|
|
|||
|
|
@ -457,6 +457,10 @@ var sortColumnsByType = map[string]map[string]string{
|
|||
"MusicGenre": {
|
||||
"sortname": "name", "name": "name",
|
||||
},
|
||||
"Playlist": {
|
||||
"sortname": "name", "name": "name",
|
||||
"datecreated": "created_at",
|
||||
},
|
||||
}
|
||||
|
||||
// sortColumn maps a single (non comma-list) Jellyfin SortBy key to the repo sort key for
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue