mirror of
https://github.com/wkulhanek/bonob.git
synced 2025-12-22 01:43:29 +01:00
Fix bug where menu item dropped from root container (#68)
This commit is contained in:
@@ -652,8 +652,6 @@ function bindSmapiSoapServiceToExpress(
|
|||||||
itemType: "albumList",
|
itemType: "albumList",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
index: 0,
|
|
||||||
total: 9,
|
|
||||||
});
|
});
|
||||||
case "search":
|
case "search":
|
||||||
return getMetadataResult({
|
return getMetadataResult({
|
||||||
@@ -674,8 +672,6 @@ function bindSmapiSoapServiceToExpress(
|
|||||||
title: lang("tracks"),
|
title: lang("tracks"),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
index: 0,
|
|
||||||
total: 3,
|
|
||||||
});
|
});
|
||||||
case "artists":
|
case "artists":
|
||||||
return musicLibrary.artists(paging).then((result) => {
|
return musicLibrary.artists(paging).then((result) => {
|
||||||
|
|||||||
@@ -950,86 +950,87 @@ describe("api", () => {
|
|||||||
index: 0,
|
index: 0,
|
||||||
count: 100,
|
count: 100,
|
||||||
});
|
});
|
||||||
|
const mediaCollection = [
|
||||||
|
{
|
||||||
|
id: "artists",
|
||||||
|
title: "Artists",
|
||||||
|
albumArtURI: iconArtURI(bonobUrl, "artists").href(),
|
||||||
|
itemType: "container",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "albums",
|
||||||
|
title: "Albums",
|
||||||
|
albumArtURI: iconArtURI(bonobUrl, "albums").href(),
|
||||||
|
itemType: "albumList",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "randomAlbums",
|
||||||
|
title: "Random",
|
||||||
|
albumArtURI: iconArtURI(bonobUrl, "random").href(),
|
||||||
|
itemType: "albumList",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "favouriteAlbums",
|
||||||
|
title: "Favourites",
|
||||||
|
albumArtURI: iconArtURI(bonobUrl, "heart").href(),
|
||||||
|
itemType: "albumList",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "starredAlbums",
|
||||||
|
title: "Top Rated",
|
||||||
|
albumArtURI: iconArtURI(bonobUrl, "star").href(),
|
||||||
|
itemType: "albumList",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "playlists",
|
||||||
|
title: "Playlists",
|
||||||
|
albumArtURI: iconArtURI(bonobUrl, "playlists").href(),
|
||||||
|
itemType: "playlist",
|
||||||
|
attributes: {
|
||||||
|
readOnly: "false",
|
||||||
|
renameable: "false",
|
||||||
|
userContent: "true",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "genres",
|
||||||
|
title: "Genres",
|
||||||
|
albumArtURI: iconArtURI(bonobUrl, "genres").href(),
|
||||||
|
itemType: "container",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "recentlyAdded",
|
||||||
|
title: "Recently added",
|
||||||
|
albumArtURI: iconArtURI(
|
||||||
|
bonobUrl,
|
||||||
|
"recentlyAdded"
|
||||||
|
).href(),
|
||||||
|
itemType: "albumList",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "recentlyPlayed",
|
||||||
|
title: "Recently played",
|
||||||
|
albumArtURI: iconArtURI(
|
||||||
|
bonobUrl,
|
||||||
|
"recentlyPlayed"
|
||||||
|
).href(),
|
||||||
|
itemType: "albumList",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "mostPlayed",
|
||||||
|
title: "Most played",
|
||||||
|
albumArtURI: iconArtURI(
|
||||||
|
bonobUrl,
|
||||||
|
"mostPlayed"
|
||||||
|
).href(),
|
||||||
|
itemType: "albumList",
|
||||||
|
},
|
||||||
|
];
|
||||||
expect(root[0]).toEqual(
|
expect(root[0]).toEqual(
|
||||||
getMetadataResult({
|
getMetadataResult({
|
||||||
mediaCollection: [
|
mediaCollection,
|
||||||
{
|
|
||||||
id: "artists",
|
|
||||||
title: "Artists",
|
|
||||||
albumArtURI: iconArtURI(bonobUrl, "artists").href(),
|
|
||||||
itemType: "container",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "albums",
|
|
||||||
title: "Albums",
|
|
||||||
albumArtURI: iconArtURI(bonobUrl, "albums").href(),
|
|
||||||
itemType: "albumList",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "randomAlbums",
|
|
||||||
title: "Random",
|
|
||||||
albumArtURI: iconArtURI(bonobUrl, "random").href(),
|
|
||||||
itemType: "albumList",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "favouriteAlbums",
|
|
||||||
title: "Favourites",
|
|
||||||
albumArtURI: iconArtURI(bonobUrl, "heart").href(),
|
|
||||||
itemType: "albumList",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "starredAlbums",
|
|
||||||
title: "Top Rated",
|
|
||||||
albumArtURI: iconArtURI(bonobUrl, "star").href(),
|
|
||||||
itemType: "albumList",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "playlists",
|
|
||||||
title: "Playlists",
|
|
||||||
albumArtURI: iconArtURI(bonobUrl, "playlists").href(),
|
|
||||||
itemType: "playlist",
|
|
||||||
attributes: {
|
|
||||||
readOnly: "false",
|
|
||||||
renameable: "false",
|
|
||||||
userContent: "true",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "genres",
|
|
||||||
title: "Genres",
|
|
||||||
albumArtURI: iconArtURI(bonobUrl, "genres").href(),
|
|
||||||
itemType: "container",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "recentlyAdded",
|
|
||||||
title: "Recently added",
|
|
||||||
albumArtURI: iconArtURI(
|
|
||||||
bonobUrl,
|
|
||||||
"recentlyAdded"
|
|
||||||
).href(),
|
|
||||||
itemType: "albumList",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "recentlyPlayed",
|
|
||||||
title: "Recently played",
|
|
||||||
albumArtURI: iconArtURI(
|
|
||||||
bonobUrl,
|
|
||||||
"recentlyPlayed"
|
|
||||||
).href(),
|
|
||||||
itemType: "albumList",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "mostPlayed",
|
|
||||||
title: "Most played",
|
|
||||||
albumArtURI: iconArtURI(
|
|
||||||
bonobUrl,
|
|
||||||
"mostPlayed"
|
|
||||||
).href(),
|
|
||||||
itemType: "albumList",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
index: 0,
|
index: 0,
|
||||||
total: 9,
|
total: mediaCollection.length,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -1043,86 +1044,87 @@ describe("api", () => {
|
|||||||
index: 0,
|
index: 0,
|
||||||
count: 100,
|
count: 100,
|
||||||
});
|
});
|
||||||
|
const mediaCollection = [
|
||||||
|
{
|
||||||
|
id: "artists",
|
||||||
|
title: "Artiesten",
|
||||||
|
albumArtURI: iconArtURI(bonobUrl, "artists").href(),
|
||||||
|
itemType: "container",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "albums",
|
||||||
|
title: "Albums",
|
||||||
|
albumArtURI: iconArtURI(bonobUrl, "albums").href(),
|
||||||
|
itemType: "albumList",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "randomAlbums",
|
||||||
|
title: "Willekeurig",
|
||||||
|
albumArtURI: iconArtURI(bonobUrl, "random").href(),
|
||||||
|
itemType: "albumList",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "favouriteAlbums",
|
||||||
|
title: "Favorieten",
|
||||||
|
albumArtURI: iconArtURI(bonobUrl, "heart").href(),
|
||||||
|
itemType: "albumList",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "starredAlbums",
|
||||||
|
title: "Best beoordeeld",
|
||||||
|
albumArtURI: iconArtURI(bonobUrl, "star").href(),
|
||||||
|
itemType: "albumList",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "playlists",
|
||||||
|
title: "Afspeellijsten",
|
||||||
|
albumArtURI: iconArtURI(bonobUrl, "playlists").href(),
|
||||||
|
itemType: "playlist",
|
||||||
|
attributes: {
|
||||||
|
readOnly: "false",
|
||||||
|
renameable: "false",
|
||||||
|
userContent: "true",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "genres",
|
||||||
|
title: "Genres",
|
||||||
|
albumArtURI: iconArtURI(bonobUrl, "genres").href(),
|
||||||
|
itemType: "container",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "recentlyAdded",
|
||||||
|
title: "Onlangs toegevoegd",
|
||||||
|
albumArtURI: iconArtURI(
|
||||||
|
bonobUrl,
|
||||||
|
"recentlyAdded"
|
||||||
|
).href(),
|
||||||
|
itemType: "albumList",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "recentlyPlayed",
|
||||||
|
title: "Onlangs afgespeeld",
|
||||||
|
albumArtURI: iconArtURI(
|
||||||
|
bonobUrl,
|
||||||
|
"recentlyPlayed"
|
||||||
|
).href(),
|
||||||
|
itemType: "albumList",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "mostPlayed",
|
||||||
|
title: "Meest afgespeeld",
|
||||||
|
albumArtURI: iconArtURI(
|
||||||
|
bonobUrl,
|
||||||
|
"mostPlayed"
|
||||||
|
).href(),
|
||||||
|
itemType: "albumList",
|
||||||
|
},
|
||||||
|
];
|
||||||
expect(root[0]).toEqual(
|
expect(root[0]).toEqual(
|
||||||
getMetadataResult({
|
getMetadataResult({
|
||||||
mediaCollection: [
|
mediaCollection,
|
||||||
{
|
|
||||||
id: "artists",
|
|
||||||
title: "Artiesten",
|
|
||||||
albumArtURI: iconArtURI(bonobUrl, "artists").href(),
|
|
||||||
itemType: "container",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "albums",
|
|
||||||
title: "Albums",
|
|
||||||
albumArtURI: iconArtURI(bonobUrl, "albums").href(),
|
|
||||||
itemType: "albumList",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "randomAlbums",
|
|
||||||
title: "Willekeurig",
|
|
||||||
albumArtURI: iconArtURI(bonobUrl, "random").href(),
|
|
||||||
itemType: "albumList",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "favouriteAlbums",
|
|
||||||
title: "Favorieten",
|
|
||||||
albumArtURI: iconArtURI(bonobUrl, "heart").href(),
|
|
||||||
itemType: "albumList",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "starredAlbums",
|
|
||||||
title: "Best beoordeeld",
|
|
||||||
albumArtURI: iconArtURI(bonobUrl, "star").href(),
|
|
||||||
itemType: "albumList",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "playlists",
|
|
||||||
title: "Afspeellijsten",
|
|
||||||
albumArtURI: iconArtURI(bonobUrl, "playlists").href(),
|
|
||||||
itemType: "playlist",
|
|
||||||
attributes: {
|
|
||||||
readOnly: "false",
|
|
||||||
renameable: "false",
|
|
||||||
userContent: "true",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "genres",
|
|
||||||
title: "Genres",
|
|
||||||
albumArtURI: iconArtURI(bonobUrl, "genres").href(),
|
|
||||||
itemType: "container",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "recentlyAdded",
|
|
||||||
title: "Onlangs toegevoegd",
|
|
||||||
albumArtURI: iconArtURI(
|
|
||||||
bonobUrl,
|
|
||||||
"recentlyAdded"
|
|
||||||
).href(),
|
|
||||||
itemType: "albumList",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "recentlyPlayed",
|
|
||||||
title: "Onlangs afgespeeld",
|
|
||||||
albumArtURI: iconArtURI(
|
|
||||||
bonobUrl,
|
|
||||||
"recentlyPlayed"
|
|
||||||
).href(),
|
|
||||||
itemType: "albumList",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "mostPlayed",
|
|
||||||
title: "Meest afgespeeld",
|
|
||||||
albumArtURI: iconArtURI(
|
|
||||||
bonobUrl,
|
|
||||||
"mostPlayed"
|
|
||||||
).href(),
|
|
||||||
itemType: "albumList",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
index: 0,
|
index: 0,
|
||||||
total: 9,
|
total: mediaCollection.length,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user