mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 21:17:37 +03:00
fix(ui): sort by favourited
This commit is contained in:
parent
27780683aa
commit
50870d3e61
3 changed files with 8 additions and 2 deletions
|
@ -77,6 +77,7 @@ func NewAlbumRepository(ctx context.Context, db dbx.Builder) model.AlbumReposito
|
||||||
"max_year": "coalesce(nullif(original_date,''), cast(max_year as text)), release_date, name, COALESCE(NULLIF(sort_album_name,''),order_album_name) asc",
|
"max_year": "coalesce(nullif(original_date,''), cast(max_year as text)), release_date, name, COALESCE(NULLIF(sort_album_name,''),order_album_name) asc",
|
||||||
"random": r.seededRandomSort(),
|
"random": r.seededRandomSort(),
|
||||||
"recently_added": recentlyAddedSort(),
|
"recently_added": recentlyAddedSort(),
|
||||||
|
"starred_at": "starred, starred_at",
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
r.sortMappings = map[string]string{
|
r.sortMappings = map[string]string{
|
||||||
|
@ -86,6 +87,7 @@ func NewAlbumRepository(ctx context.Context, db dbx.Builder) model.AlbumReposito
|
||||||
"max_year": "coalesce(nullif(original_date,''), cast(max_year as text)), release_date, name, order_album_name asc",
|
"max_year": "coalesce(nullif(original_date,''), cast(max_year as text)), release_date, name, order_album_name asc",
|
||||||
"random": r.seededRandomSort(),
|
"random": r.seededRandomSort(),
|
||||||
"recently_added": recentlyAddedSort(),
|
"recently_added": recentlyAddedSort(),
|
||||||
|
"starred_at": "starred, starred_at",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,10 +69,12 @@ func NewArtistRepository(ctx context.Context, db dbx.Builder) model.ArtistReposi
|
||||||
if conf.Server.PreferSortTags {
|
if conf.Server.PreferSortTags {
|
||||||
r.sortMappings = map[string]string{
|
r.sortMappings = map[string]string{
|
||||||
"name": "COALESCE(NULLIF(sort_artist_name,''),order_artist_name)",
|
"name": "COALESCE(NULLIF(sort_artist_name,''),order_artist_name)",
|
||||||
|
"starred_at": "starred, starred_at",
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
r.sortMappings = map[string]string{
|
r.sortMappings = map[string]string{
|
||||||
"name": "order_artist_name",
|
"name": "order_artist_name",
|
||||||
|
"starred_at": "starred, starred_at",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return r
|
return r
|
||||||
|
|
|
@ -39,6 +39,7 @@ func NewMediaFileRepository(ctx context.Context, db dbx.Builder) *mediaFileRepos
|
||||||
"random": r.seededRandomSort(),
|
"random": r.seededRandomSort(),
|
||||||
"created_at": "media_file.created_at",
|
"created_at": "media_file.created_at",
|
||||||
"track_number": "album, release_date, disc_number, track_number",
|
"track_number": "album, release_date, disc_number, track_number",
|
||||||
|
"starred_at": "starred, starred_at",
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
r.sortMappings = map[string]string{
|
r.sortMappings = map[string]string{
|
||||||
|
@ -48,6 +49,7 @@ func NewMediaFileRepository(ctx context.Context, db dbx.Builder) *mediaFileRepos
|
||||||
"random": r.seededRandomSort(),
|
"random": r.seededRandomSort(),
|
||||||
"created_at": "media_file.created_at",
|
"created_at": "media_file.created_at",
|
||||||
"track_number": "album, release_date, disc_number, track_number",
|
"track_number": "album, release_date, disc_number, track_number",
|
||||||
|
"starred_at": "starred, starred_at",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return r
|
return r
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue