Fixing Hubs output

This commit is contained in:
luke-hagar-sp
2022-08-01 16:07:47 -05:00
parent 602a1e68d2
commit b89bf36a5e
2 changed files with 17 additions and 18 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "plex-api-oauth", "name": "plex-api-oauth",
"version": "1.1.114", "version": "1.1.116",
"description": "An NPM Module designed to make Plex Media Server and plex.tv API calls easier to implement in JavaScript and React projects", "description": "An NPM Module designed to make Plex Media Server and plex.tv API calls easier to implement in JavaScript and React projects",
"main": "./src/index.js", "main": "./src/index.js",
"type": "module", "type": "module",

View File

@@ -968,7 +968,7 @@ export async function GetMusicHub(
for (const hub of response.data.MediaContainer.Hub) { for (const hub of response.data.MediaContainer.Hub) {
let hubMetaData = []; let hubMetaData = [];
if (hub.size > 1) { if (hub.size > 1 && hub.type !== "station") {
for (const metaDataEntry of hub.Metadata) { for (const metaDataEntry of hub.Metadata) {
let metaEntry = { let metaEntry = {
Genre: metaDataEntry.Genre, Genre: metaDataEntry.Genre,
@@ -1039,11 +1039,9 @@ export async function GetMusicHub(
viewCount: metaDataEntry.viewCount, viewCount: metaDataEntry.viewCount,
}; };
} }
if (metaDataEntry.type !== "station") {
hubMetaData.push(metaEntry); hubMetaData.push(metaEntry);
} }
}
}
hubs.push({ hubs.push({
Metadata: hubMetaData, Metadata: hubMetaData,
context: hub.context, context: hub.context,
@@ -1060,5 +1058,6 @@ export async function GetMusicHub(
} }
} }
} }
}
return hubs; return hubs;
} }