Fix artwork resolution when paths contains :. Fix #2137

This commit is contained in:
Deluan 2023-02-02 12:13:24 -05:00
parent f904784e67
commit 9b81aa4403
7 changed files with 16 additions and 8 deletions

View file

@ -151,7 +151,7 @@ func (mfs MediaFiles) ToAlbum() Album {
a.EmbedArtPath = m.Path
}
}
a.Paths = strings.Join(mfs.Dirs(), string(filepath.ListSeparator))
a.Paths = strings.Join(mfs.Dirs(), consts.Zwsp)
comments = slices.Compact(comments)
if len(comments) == 1 {
a.Comment = comments[0]

View file

@ -5,6 +5,7 @@ import (
"github.com/navidrome/navidrome/conf"
"github.com/navidrome/navidrome/conf/configtest"
"github.com/navidrome/navidrome/consts"
. "github.com/navidrome/navidrome/model"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
@ -52,7 +53,7 @@ var _ = Describe("MediaFiles", func() {
Expect(album.CatalogNum).To(Equal("CatalogNum"))
Expect(album.Compilation).To(BeTrue())
Expect(album.EmbedArtPath).To(Equal("/music2/file2.mp3"))
Expect(album.Paths).To(Equal("/music1:/music2"))
Expect(album.Paths).To(Equal("/music1" + consts.Zwsp + "/music2"))
})
})
Context("Aggregated attributes", func() {