Ability to browse Random Albums

This commit is contained in:
simojenki
2021-03-23 10:42:49 +11:00
parent 8f5905c16f
commit 4730511a84
8 changed files with 185 additions and 89 deletions

View File

@@ -556,9 +556,10 @@ describe("api", () => {
{ itemType: "container", id: "artists", title: "Artists" },
{ itemType: "container", id: "albums", title: "Albums" },
{ itemType: "container", id: "genres", title: "Genres" },
{ itemType: "container", id: "randomAlbums", title: "Random" },
],
index: 0,
total: 3,
total: 4,
})
);
});
@@ -889,6 +890,19 @@ describe("api", () => {
musicService.hasArtists(artist1, artist2, artist3, artist4);
});
describe("asking for random albums", () => {
it("should return some", async () => {
const result = await ws.getMetadataAsync({
id: "randomAlbums",
index: 0,
count: 100,
});
expect(result[0].getMetadataResult.index).toEqual(0);
expect(result[0].getMetadataResult.count).toEqual(6);
expect(result[0].getMetadataResult.total).toEqual(6);
});
});
describe("asking for all albums", () => {
it("should return them all", async () => {
const result = await ws.getMetadataAsync({