fix(subsonic): fix support for LegacyClients

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan
2026-01-25 17:59:12 -05:00
parent 772d1f359b
commit 4d4740b83b
2 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -240,7 +240,7 @@ func childFromMediaFile(ctx context.Context, mf model.MediaFile) responses.Child
func osChildFromMediaFile(ctx context.Context, mf model.MediaFile) *responses.OpenSubsonicChild { func osChildFromMediaFile(ctx context.Context, mf model.MediaFile) *responses.OpenSubsonicChild {
player, ok := request.PlayerFrom(ctx) player, ok := request.PlayerFrom(ctx)
if ok && isClientInList(conf.Server.Subsonic.MinimalClients, player.Client) { if ok && isClientInList(conf.Server.Subsonic.LegacyClients, player.Client) {
return nil return nil
} }
child := responses.OpenSubsonicChild{} child := responses.OpenSubsonicChild{}
+7 -7
View File
@@ -308,10 +308,10 @@ var _ = Describe("helpers", func() {
ctx = context.Background() ctx = context.Background()
}) })
Context("with minimal client", func() { Context("with legacy client", func() {
BeforeEach(func() { BeforeEach(func() {
conf.Server.Subsonic.MinimalClients = "minimal-client" conf.Server.Subsonic.LegacyClients = "legacy-client"
player := model.Player{Client: "minimal-client"} player := model.Player{Client: "legacy-client"}
ctx = request.WithPlayer(ctx, player) ctx = request.WithPlayer(ctx, player)
}) })
@@ -321,9 +321,9 @@ var _ = Describe("helpers", func() {
}) })
}) })
Context("with non-minimal client", func() { Context("with non-legacy client", func() {
BeforeEach(func() { BeforeEach(func() {
conf.Server.Subsonic.MinimalClients = "minimal-client" conf.Server.Subsonic.LegacyClients = "legacy-client"
player := model.Player{Client: "regular-client"} player := model.Player{Client: "regular-client"}
ctx = request.WithPlayer(ctx, player) ctx = request.WithPlayer(ctx, player)
}) })
@@ -335,9 +335,9 @@ var _ = Describe("helpers", func() {
}) })
}) })
Context("when minimal clients list is empty", func() { Context("when legacy clients list is empty", func() {
BeforeEach(func() { BeforeEach(func() {
conf.Server.Subsonic.MinimalClients = "" conf.Server.Subsonic.LegacyClients = ""
player := model.Player{Client: "any-client"} player := model.Player{Client: "any-client"}
ctx = request.WithPlayer(ctx, player) ctx = request.WithPlayer(ctx, player)
}) })