|
|
@ -18724,6 +18724,12 @@ class Plex {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return this.exportSectionsData(await Promise.all(sectionsRequests));
|
|
|
|
return this.exportSectionsData(await Promise.all(sectionsRequests));
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
this.getDetails = async (id) => {
|
|
|
|
|
|
|
|
const url = `${this.protocol}://${this.ip}:${this.port}/library/metadata/${id}?includeConcerts=1&includeExtras=1&includeOnDeck=1&includePopularLeaves=1&includePreferences=1&includeReviews=1&includeChapters=1&includeStations=1&includeExternalMedia=1&asyncAugmentMetadata=1&asyncCheckFiles=1&asyncRefreshAnalysis=1&asyncRefreshLocalMediaAgent=1&X-Plex-Token=${this.token}`;
|
|
|
|
|
|
|
|
return (await axios.get(url, {
|
|
|
|
|
|
|
|
timeout: this.requestTimeout
|
|
|
|
|
|
|
|
})).data.MediaContainer.Metadata[0];
|
|
|
|
|
|
|
|
};
|
|
|
|
this.getLibraryData = async (id) => {
|
|
|
|
this.getLibraryData = async (id) => {
|
|
|
|
const url = `${this.protocol}://${this.ip}:${this.port}/library/metadata/${id}/children?X-Plex-Token=${this.token}`;
|
|
|
|
const url = `${this.protocol}://${this.ip}:${this.port}/library/metadata/${id}/children?X-Plex-Token=${this.token}`;
|
|
|
|
return (await axios.get(url, {
|
|
|
|
return (await axios.get(url, {
|
|
|
@ -20032,7 +20038,8 @@ class PlexMeetsHomeAssistant extends HTMLElement {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, 200);
|
|
|
|
}, 200);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (this.plex && data.childCount > 0) {
|
|
|
|
if (this.plex) {
|
|
|
|
|
|
|
|
if (data.childCount > 0) {
|
|
|
|
this.seasonElemFreshlyLoaded = true;
|
|
|
|
this.seasonElemFreshlyLoaded = true;
|
|
|
|
const seasonsData = await this.plex.getLibraryData(data.key.split('/')[3]);
|
|
|
|
const seasonsData = await this.plex.getLibraryData(data.key.split('/')[3]);
|
|
|
|
if (this.seasonsElem) {
|
|
|
|
if (this.seasonsElem) {
|
|
|
@ -20237,6 +20244,10 @@ class PlexMeetsHomeAssistant extends HTMLElement {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, 200);
|
|
|
|
}, 200);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
console.log(await this.plex.getDetails(data.key.split('/')[3]));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
this.resizeBackground = () => {
|
|
|
|
this.resizeBackground = () => {
|
|
|
|
if (this.seasonsElem && this.episodesElem && this.card) {
|
|
|
|
if (this.seasonsElem && this.episodesElem && this.card) {
|
|
|
|