From 884e87609cc6080ca01c99b84de4cf746d42711b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Nyi=CC=81ri?= Date: Sat, 8 May 2021 22:59:26 +0200 Subject: [PATCH] Update: Enable instant play for seasons and tv shows for Android TV --- dist/plex-meets-homeassistant.js | 10 ++++++++-- src/plex-meets-homeassistant.ts | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/dist/plex-meets-homeassistant.js b/dist/plex-meets-homeassistant.js index e76f07d..57cb98d 100644 --- a/dist/plex-meets-homeassistant.js +++ b/dist/plex-meets-homeassistant.js @@ -18670,6 +18670,12 @@ var axios = axios_1; class Plex { constructor(ip, port = 32400, token, protocol = 'http') { this.serverInfo = {}; + this.clients = []; + this.getClients = async () => { + const url = `${this.protocol}://${this.ip}:${this.port}/clients?X-Plex-Token=${this.token}`; + const result = await axios.get(url); + return result; + }; this.getServerID = async () => { if (lodash.isEmpty(this.serverInfo)) { await this.getServerInfo(); @@ -19902,7 +19908,7 @@ class PlexMeetsHomeAssistant extends HTMLElement { playButton.addEventListener('click', event => { event.stopPropagation(); if (this.plex && this.playController) { - this.playController.play(seasonData); + this.playController.play(seasonData, true); } }); interactiveArea.append(playButton); @@ -20151,7 +20157,7 @@ class PlexMeetsHomeAssistant extends HTMLElement { playButton.addEventListener('click', event => { event.stopPropagation(); if (this.hassObj && this.playController) { - this.playController.play(data, data.type === 'movie'); + this.playController.play(data, true); } }); const titleElem = document.createElement('div'); diff --git a/src/plex-meets-homeassistant.ts b/src/plex-meets-homeassistant.ts index 390e62f..d4156e0 100644 --- a/src/plex-meets-homeassistant.ts +++ b/src/plex-meets-homeassistant.ts @@ -505,7 +505,7 @@ class PlexMeetsHomeAssistant extends HTMLElement { playButton.addEventListener('click', event => { event.stopPropagation(); if (this.plex && this.playController) { - this.playController.play(seasonData); + this.playController.play(seasonData, true); } }); @@ -792,7 +792,7 @@ class PlexMeetsHomeAssistant extends HTMLElement { event.stopPropagation(); if (this.hassObj && this.playController) { - this.playController.play(data, data.type === 'movie'); + this.playController.play(data, true); } });