From 0883a5dcc487b67ae3a19ac28796a99ef7f64b14 Mon Sep 17 00:00:00 2001 From: junkerderprovinz Date: Sun, 9 Aug 2026 16:48:13 +0200 Subject: [PATCH] fix(playlists): normalize folder path to forward slashes for PlaylistsPath glob on Windows (#5381) Signed-off-by: junkerderprovinz --- core/playlists/import_test.go | 5 +++-- core/playlists/playlists.go | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/core/playlists/import_test.go b/core/playlists/import_test.go index f2866fb60..09f177d9d 100644 --- a/core/playlists/import_test.go +++ b/core/playlists/import_test.go @@ -970,8 +970,9 @@ var _ = Describe("Playlists - Import", func() { }) It("returns true if folder is in PlaylistsPath", func() { - tests.SkipOnWindows("path separator bug (#TBD-path-sep-playlists)") - conf.Server.PlaylistsPath = "other/**:playlists/**" + // Build the multi-pattern list with the OS path-list separator + // (":" on Unix, ";" on Windows) so InPath splits it correctly. + conf.Server.PlaylistsPath = strings.Join([]string{"other/**", "playlists/**"}, string(filepath.ListSeparator)) Expect(playlists.InPath(folder)).To(BeTrue()) }) diff --git a/core/playlists/playlists.go b/core/playlists/playlists.go index 1ef083bbb..49e99c670 100644 --- a/core/playlists/playlists.go +++ b/core/playlists/playlists.go @@ -73,6 +73,10 @@ func InPath(folder model.Folder) bool { return true } rel, _ := filepath.Rel(folder.LibraryPath, folder.AbsolutePath()) + // doublestar globs always use "/" as the separator (and treat "\" as an + // escape), but filepath.Rel returns OS separators, so on Windows the + // back-slashed rel never matches a "foo/**" pattern. Normalize to slashes. + rel = filepath.ToSlash(rel) for path := range strings.SplitSeq(conf.Server.PlaylistsPath, string(filepath.ListSeparator)) { if match, _ := doublestar.Match(path, rel); match { return true