From b5121c15bec13ab247c66d28ba1752a4f4d7b270 Mon Sep 17 00:00:00 2001 From: Deluan Date: Sat, 19 Sep 2026 18:03:34 -0400 Subject: [PATCH] test(smartplaylists): store the Unicode child path in OS-native form Playlist.Path is OS-native, so on Windows the forward-slash fixture never matched the normalized reference. --- persistence/smart_playlist_repository_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/persistence/smart_playlist_repository_test.go b/persistence/smart_playlist_repository_test.go index f6d09a5fc..33da0c1b7 100644 --- a/persistence/smart_playlist_repository_test.go +++ b/persistence/smart_playlist_repository_test.go @@ -1,6 +1,7 @@ package persistence import ( + "path/filepath" "time" "github.com/navidrome/navidrome/conf" @@ -222,14 +223,14 @@ var _ = Describe("PlaylistRepository - Smart Playlists", func() { It("matches a child path stored in a different Unicode normalization form", func() { conf.Server.SmartPlaylistRefreshDelay = -1 * time.Second - child := model.Playlist{Name: "NFD Child", OwnerID: "userid", Public: true, Path: "/música/child.nsp", Rules: &criteria.Criteria{ + child := model.Playlist{Name: "NFD Child", OwnerID: "userid", Public: true, Path: filepath.FromSlash("/mu\u0301sica/child.nsp"), Rules: &criteria.Criteria{ Expression: criteria.All{criteria.Contains{"title": "Day"}}, }} Expect(repo.Put(&child)).To(Succeed()) DeferCleanup(func() { _ = repo.Delete(child.ID) }) parent := model.Playlist{Name: "NFC Parent", OwnerID: "userid", Rules: &criteria.Criteria{ - Expression: criteria.All{criteria.InPlaylist{"path": "/música/child.nsp"}}, + Expression: criteria.All{criteria.InPlaylist{"path": "/m\u00fasica/child.nsp"}}, }} Expect(repo.Put(&parent)).To(Succeed()) DeferCleanup(func() { _ = repo.Delete(parent.ID) })