From 2d4f201d08bb710fc260628a225aaf828294cd1a Mon Sep 17 00:00:00 2001 From: Simon J Date: Wed, 27 Oct 2021 13:08:12 +1100 Subject: [PATCH] Add PageSize of 30 to presentation map to reduce load when requesting artists (#69) --- src/server.ts | 1 + tests/smapi.test.ts | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/src/server.ts b/src/server.ts index de42a15..14587b9 100644 --- a/src/server.ts +++ b/src/server.ts @@ -281,6 +281,7 @@ function server( res.type("application/xml").send(` + diff --git a/tests/smapi.test.ts b/tests/smapi.test.ts index 4a08b4c..ef6b772 100644 --- a/tests/smapi.test.ts +++ b/tests/smapi.test.ts @@ -158,6 +158,17 @@ describe("service config", () => { ); } + it("should have a PageSize of specified", async () => { + const xml = await presentationMapXml(); + + const pageSize = xpath.select( + `string(/Presentation/BrowseOptions/@PageSize)`, + xml + ); + + expect(pageSize).toEqual('30'); + }); + it("should have an ArtWorkSizeMap for all sizes recommended by sonos", async () => { const xml = await presentationMapXml();