extracted cover art handling from library package

This commit is contained in:
2026-02-25 15:31:05 -05:00
parent 5689c1be42
commit baa4644ece
11 changed files with 320 additions and 114 deletions
+3 -5
View File
@@ -6,7 +6,7 @@ import (
"path/filepath"
"time"
"yellowjacket/backend/system"
"yellowjacket/backend/coverart"
)
// FullRescan clears the queue and player, wipes all library data
@@ -182,15 +182,13 @@ func (l *Library) clearLibraryTables() error {
// clearCoverArtFiles removes all files from the covers directory.
func (l *Library) clearCoverArtFiles() error {
dataDir, err := system.GetUserDataDirPath()
coverDir, err := coverart.CoversDir()
if err != nil {
return fmt.Errorf(
"could not get user data directory: %w", err,
"could not resolve covers directory: %w", err,
)
}
coverDir := filepath.Join(dataDir, "covers")
entries, err := os.ReadDir(coverDir)
if err != nil {
if os.IsNotExist(err) {