fix(artwork): preserve the drive when normalizing Windows file:// library paths

url.Parse puts the volume of file://C:/Music in Host, not Path, so localOSRoot dropped
it and returned /Music — os.Open/os.Stat then failed and folder/embedded art on Windows
looped as dangling. Rejoin the host volume, matching core/storage/local's newLocalStorage.
This commit is contained in:
Deluan 2026-07-23 10:40:31 -04:00
parent aba7ed925c
commit f92507b152

View File

@ -55,5 +55,10 @@ func localOSRoot(libPath string) string {
if err != nil || u.Scheme != storage.LocalSchemaID {
return libPath
}
// Windows drive URLs (file://C:/Music) put the volume in Host; rejoin it, matching
// core/storage/local's newLocalStorage so os.Open/os.Stat get a valid path.
if filepath.VolumeName(u.Host) != "" {
return filepath.Join(u.Host, u.Path)
}
return u.Path
}