Update: Show seasons on episodes view

pull/16/head
Juraj Nyíri 4 years ago
parent 31cf1beb20
commit d643528e64

@ -20426,9 +20426,15 @@ class PlexMeetsHomeAssistant extends HTMLElement {
}, 200);
}
if (this.plex) {
if (data.childCount > 0) {
let seasonsData = {};
if (lodash.isEqual(data.type, 'episode')) {
seasonsData = await this.plex.getLibraryData(data.grandparentKey.split('/')[3]);
}
else if (data.childCount > 0) {
seasonsData = await this.plex.getLibraryData(data.key.split('/')[3]);
}
if (!lodash.isEmpty(seasonsData)) {
this.seasonElemFreshlyLoaded = true;
const seasonsData = await this.plex.getLibraryData(data.key.split('/')[3]);
if (this.seasonsElem) {
this.seasonsElem.style.display = 'block';
this.seasonsElem.innerHTML = '';

@ -745,9 +745,14 @@ class PlexMeetsHomeAssistant extends HTMLElement {
}, 200);
}
if (this.plex) {
if (data.childCount > 0) {
let seasonsData: Record<string, any> = {};
if (_.isEqual(data.type, 'episode')) {
seasonsData = await this.plex.getLibraryData(data.grandparentKey.split('/')[3]);
} else if (data.childCount > 0) {
seasonsData = await this.plex.getLibraryData(data.key.split('/')[3]);
}
if (!_.isEmpty(seasonsData)) {
this.seasonElemFreshlyLoaded = true;
const seasonsData = await this.plex.getLibraryData(data.key.split('/')[3]);
if (this.seasonsElem) {
this.seasonsElem.style.display = 'block';
this.seasonsElem.innerHTML = '';

Loading…
Cancel
Save