mirror of
https://github.com/navidrome/navidrome.git
synced 2026-08-31 07:30:32 +00:00
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:
parent
aba7ed925c
commit
f92507b152
@ -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
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user