diff --git a/dist/plex-meets-homeassistant.js b/dist/plex-meets-homeassistant.js index 1ac58b3..753597a 100644 --- a/dist/plex-meets-homeassistant.js +++ b/dist/plex-meets-homeassistant.js @@ -21146,7 +21146,9 @@ class PlexMeetsHomeAssistant extends HTMLElement { collectionToGet = collection; } }); - this.data[collectionToGet.title] = await this.plex.getCollectionData(collectionToGet.key); + if (!lodash.isNil(collectionToGet.key)) { + this.data[collectionToGet.title] = await this.plex.getCollectionData(collectionToGet.key); + } if (this.data[this.config.libraryName] === undefined) { this.error = `Library name ${this.config.libraryName} does not exist.`; } diff --git a/src/plex-meets-homeassistant.ts b/src/plex-meets-homeassistant.ts index 1a7f548..a51eeed 100644 --- a/src/plex-meets-homeassistant.ts +++ b/src/plex-meets-homeassistant.ts @@ -433,7 +433,9 @@ class PlexMeetsHomeAssistant extends HTMLElement { collectionToGet = collection; } }); - this.data[collectionToGet.title] = await this.plex.getCollectionData(collectionToGet.key); + if (!_.isNil(collectionToGet.key)) { + this.data[collectionToGet.title] = await this.plex.getCollectionData(collectionToGet.key); + } if (this.data[this.config.libraryName] === undefined) { this.error = `Library name ${this.config.libraryName} does not exist.`;