fix(artwork): always select the coverArt of the first disc in multi-disc albums (#3950)

* feat(artwork): sort image files for consistent cover art selection

Signed-off-by: Deluan <deluan@navidrome.org>

* feat(artwork): improve album cover art selection by considering disc numbers

Signed-off-by: Deluan <deluan@navidrome.org>

---------

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan Quintão
2025-04-11 23:39:57 -04:00
committed by GitHub
parent bcea8b832a
commit 49b8cfc261
4 changed files with 205 additions and 3 deletions
+6
View File
@@ -6,6 +6,7 @@ import (
"fmt"
"io"
"path/filepath"
"slices"
"strings"
"time"
@@ -113,5 +114,10 @@ func loadAlbumFoldersPaths(ctx context.Context, ds model.DataStore, albums ...mo
imgFiles = append(imgFiles, filepath.Join(path, img))
}
}
// Sort image files to ensure consistent selection of cover art
// This prioritizes files from lower-numbered disc folders by sorting the paths
slices.Sort(imgFiles)
return paths, imgFiles, &updatedAt, nil
}