mirror of
https://github.com/navidrome/navidrome.git
synced 2026-10-08 10:27:08 +02:00
On Windows, filepath.Rel never returns when the base is a UNC share root (\\host\share) and the target is the same root with a trailing separator (golang/go#79784, fixed only in Go 1.28 by CL 786100). A user on Windows Server with MusicFolder='\\server\Music' (discussion #6232) sent CPU profiles showing 96% of CPU time in filepath.Rel, called from fromArtistFolder <- resolveArtistFolderPattern <- resolver.resolveArtist. For an album directly under the library root, loadArtistFolder's filepath.Dir returns '\\server\Music\', so the artwork worker spins forever and, because Worker.drain waits for the whole batch, the artist artwork pool stops. Add utils.RelPath, which normalizes a UNC volume root followed only by separators to the volume plus one separator before calling filepath.Rel. Both sides then compare equal and Rel returns '.' before reaching the loop. A bare '\\host\share' target under a deeper base now also gives '..' instead of an error. Drive-letter paths are left unchanged, and on non-Windows systems the helper behaves exactly like filepath.Rel. Use it at every production filepath.Rel call site: artist folder artwork, scanner library-relative paths, the watcher, playlist path resolution and PlaylistsPath matching, and the cache spread FS. Windows-only tests cover the UNC cases, with a timeout so a regression fails instead of hanging CI. Run under Wine, 6 of them fail with plain filepath.Rel (4 by timeout) and all pass with RelPath. The helper can be removed after moving to Go 1.28. |
||
|---|---|---|
| .. | ||
| cache | ||
| chrono | ||
| gg | ||
| gravatar | ||
| hasher | ||
| httpclient | ||
| ioutils | ||
| jsoncommentstrip | ||
| merge | ||
| nanoid | ||
| natural | ||
| netguard | ||
| number | ||
| pl | ||
| random | ||
| req | ||
| run | ||
| shellquote | ||
| singleton | ||
| slice | ||
| str | ||
| context.go | ||
| context_test.go | ||
| encrypt.go | ||
| encrypt_test.go | ||
| files.go | ||
| files_test.go | ||
| files_windows_test.go | ||
| index_group_parser.go | ||
| index_group_parser_test.go | ||
| limiter.go | ||
| time.go | ||
| time_test.go | ||
| utils_suite_test.go | ||