mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 04:57:37 +03:00
Sort songs by artist/album/disc/track_number before adding to playlist
This commit is contained in:
parent
e673360087
commit
fba733708c
1 changed files with 2 additions and 0 deletions
|
@ -116,8 +116,10 @@ func (r *playlistTrackRepository) AddDiscs(discs []model.DiscID) (int, error) {
|
|||
|
||||
func (r *playlistTrackRepository) addMediaFileIds(sq SelectBuilder) (int, error) {
|
||||
var res []struct{ Id string }
|
||||
sq = sq.OrderBy("album_artist, album, disc_number, track_number")
|
||||
err := r.queryAll(sq, &res)
|
||||
if err != nil {
|
||||
log.Error(r.ctx, "Error getting tracks to add to playlist", err)
|
||||
return 0, err
|
||||
}
|
||||
if len(res) == 0 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue