🎧 Your Personal Streaming Service
Go airsonicmadsonicmedia-servermusicmusic-servernavidromeopensubsonicraspberry-piself-hostedstreamerstreaming-apistreaming-audiosubsonicsubsonic-server
Fix album sort fields
Deluand8699b03bd89
diff --git a/persistence/album_repository.go b/persistence/album_repository.goindex 19f398c0f..205f2f538 100644--- a/persistence/album_repository.go+++ b/persistence/album_repository.go@@ -26,8 +26,10 @@ func NewAlbumRepository(ctx context.Context, o orm.Ormer) model.AlbumRepositoryr.ormer = or.tableName = "album"r.sortMappings = map[string]string{- "artist": "compilation asc, order_album_artist_name asc, order_album_name asc",- "random": "RANDOM()",+ "name": "order_album_name",+ "artist": "compilation asc, order_album_artist_name asc, order_album_name asc",+ "random": "RANDOM()",+ "max_year": "max_year asc, name, order_album_name asc",}r.filterMappings = map[string]filterFunc{"name": fullTextFilter,diff --git a/persistence/persistence_suite_test.go b/persistence/persistence_suite_test.goindex 1643622bf..8b2968ce2 100644--- a/persistence/persistence_suite_test.go+++ b/persistence/persistence_suite_test.go@@ -40,9 +40,9 @@ var ()var (- albumSgtPeppers = model.Album{ID: "101", Name: "Sgt Peppers", Artist: "The Beatles", AlbumArtistID: "3", Genre: "Rock", CoverArtId: "1", CoverArtPath: P("/beatles/1/sgt/a day.mp3"), SongCount: 1, MaxYear: 1967, FullText: " beatles peppers sgt the"}- albumAbbeyRoad = model.Album{ID: "102", Name: "Abbey Road", Artist: "The Beatles", AlbumArtistID: "3", Genre: "Rock", CoverArtId: "2", CoverArtPath: P("/beatles/1/come together.mp3"), SongCount: 1, MaxYear: 1969, FullText: " abbey beatles road the"}- albumRadioactivity = model.Album{ID: "103", Name: "Radioactivity", Artist: "Kraftwerk", AlbumArtistID: "2", Genre: "Electronic", CoverArtId: "3", CoverArtPath: P("/kraft/radio/radio.mp3"), SongCount: 2, FullText: " kraftwerk radioactivity"}+ albumSgtPeppers = model.Album{ID: "101", Name: "Sgt Peppers", Artist: "The Beatles", OrderAlbumName: "sgt peppers", AlbumArtistID: "3", Genre: "Rock", CoverArtId: "1", CoverArtPath: P("/beatles/1/sgt/a day.mp3"), SongCount: 1, MaxYear: 1967, FullText: " beatles peppers sgt the"}+ albumAbbeyRoad = model.Album{ID: "102", Name: "Abbey Road", Artist: "The Beatles", OrderAlbumName: "abbey road", AlbumArtistID: "3", Genre: "Rock", CoverArtId: "2", CoverArtPath: P("/beatles/1/come together.mp3"), SongCount: 1, MaxYear: 1969, FullText: " abbey beatles road the"}+ albumRadioactivity = model.Album{ID: "103", Name: "Radioactivity", Artist: "Kraftwerk", OrderAlbumName: "radioactivity", AlbumArtistID: "2", Genre: "Electronic", CoverArtId: "3", CoverArtPath: P("/kraft/radio/radio.mp3"), SongCount: 2, FullText: " kraftwerk radioactivity"}testAlbums = model.Albums{albumSgtPeppers,albumAbbeyRoad,