From 415db4c4bd4333fb3ac7de88f26e66235d53afa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Nyi=CC=81ri?= Date: Fri, 3 Sep 2021 00:20:30 +0200 Subject: [PATCH] More cleanup --- dist/plex-meets-homeassistant.js | 6 +++--- src/modules/PlayController.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/plex-meets-homeassistant.js b/dist/plex-meets-homeassistant.js index 06a9a97..9f1b094 100644 --- a/dist/plex-meets-homeassistant.js +++ b/dist/plex-meets-homeassistant.js @@ -19401,7 +19401,7 @@ class PlayController { const entity = this.getPlayService(data); let processData = data; let provider; - if (!lodash.isNil(data.epg)) { + if (lodash.isEqual(data.type, 'epg')) { processData = data.epg; provider = ''; } @@ -19410,7 +19410,7 @@ class PlayController { await this.playViaKodi(entity.value, data, data.type); break; case 'androidtv': - if (!lodash.isNil(data.epg)) { + if (lodash.isEqual(data.type, 'epg')) { const session = `${Math.floor(Date.now() / 1000)}`; const streamLink = await this.plex.tune(data.channelIdentifier, session); console.log(streamLink); @@ -19424,7 +19424,7 @@ class PlayController { await this.playViaPlexPlayer(entity.value, processData.key.split('/')[3]); break; case 'cast': - if (!lodash.isNil(data.epg)) { + if (lodash.isEqual(data.type, 'epg')) { const session = `PlexMeetsHomeAssistant-${Math.floor(Date.now() / 1000)}`; const streamURL = await this.plex.tune(data.channelIdentifier, session); console.log(`${this.plex.getBasicURL()}${streamURL}`); diff --git a/src/modules/PlayController.ts b/src/modules/PlayController.ts index 80f62f5..0dc0193 100644 --- a/src/modules/PlayController.ts +++ b/src/modules/PlayController.ts @@ -120,7 +120,7 @@ class PlayController { let processData = data; let provider; - if (!_.isNil(data.epg)) { + if (_.isEqual(data.type, 'epg')) { processData = data.epg; provider = ''; } @@ -129,7 +129,7 @@ class PlayController { await this.playViaKodi(entity.value, data, data.type); break; case 'androidtv': - if (!_.isNil(data.epg)) { + if (_.isEqual(data.type, 'epg')) { const session = `${Math.floor(Date.now() / 1000)}`; const streamLink = await this.plex.tune(data.channelIdentifier, session); console.log(streamLink); @@ -144,7 +144,7 @@ class PlayController { await this.playViaPlexPlayer(entity.value, processData.key.split('/')[3]); break; case 'cast': - if (!_.isNil(data.epg)) { + if (_.isEqual(data.type, 'epg')) { const session = `PlexMeetsHomeAssistant-${Math.floor(Date.now() / 1000)}`; const streamURL = await this.plex.tune(data.channelIdentifier, session); console.log(`${this.plex.getBasicURL()}${streamURL}`);