mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-23 10:29:46 +01: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
1 changed files with 5 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue