fix(ui): sort by favourited

This commit is contained in:
Deluan 2024-09-19 13:05:26 -04:00
parent 27780683aa
commit 50870d3e61
3 changed files with 8 additions and 2 deletions

View file

@ -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",
"random": r.seededRandomSort(),
"recently_added": recentlyAddedSort(),
"starred_at": "starred, starred_at",
}
} else {
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",
"random": r.seededRandomSort(),
"recently_added": recentlyAddedSort(),
"starred_at": "starred, starred_at",
}
}

View file

@ -69,10 +69,12 @@ func NewArtistRepository(ctx context.Context, db dbx.Builder) model.ArtistReposi
if conf.Server.PreferSortTags {
r.sortMappings = map[string]string{
"name": "COALESCE(NULLIF(sort_artist_name,''),order_artist_name)",
"starred_at": "starred, starred_at",
}
} else {
r.sortMappings = map[string]string{
"name": "order_artist_name",
"starred_at": "starred, starred_at",
}
}
return r

View file

@ -39,6 +39,7 @@ func NewMediaFileRepository(ctx context.Context, db dbx.Builder) *mediaFileRepos
"random": r.seededRandomSort(),
"created_at": "media_file.created_at",
"track_number": "album, release_date, disc_number, track_number",
"starred_at": "starred, starred_at",
}
} else {
r.sortMappings = map[string]string{
@ -48,6 +49,7 @@ func NewMediaFileRepository(ctx context.Context, db dbx.Builder) *mediaFileRepos
"random": r.seededRandomSort(),
"created_at": "media_file.created_at",
"track_number": "album, release_date, disc_number, track_number",
"starred_at": "starred, starred_at",
}
}
return r