Update: Enable instant play for seasons and tv shows for Android TV

pull/16/head
Juraj Nyíri 4 years ago
parent 693e6c2481
commit 884e87609c

@ -18670,6 +18670,12 @@ var axios = axios_1;
class Plex { class Plex {
constructor(ip, port = 32400, token, protocol = 'http') { constructor(ip, port = 32400, token, protocol = 'http') {
this.serverInfo = {}; 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 () => { this.getServerID = async () => {
if (lodash.isEmpty(this.serverInfo)) { if (lodash.isEmpty(this.serverInfo)) {
await this.getServerInfo(); await this.getServerInfo();
@ -19902,7 +19908,7 @@ class PlexMeetsHomeAssistant extends HTMLElement {
playButton.addEventListener('click', event => { playButton.addEventListener('click', event => {
event.stopPropagation(); event.stopPropagation();
if (this.plex && this.playController) { if (this.plex && this.playController) {
this.playController.play(seasonData); this.playController.play(seasonData, true);
} }
}); });
interactiveArea.append(playButton); interactiveArea.append(playButton);
@ -20151,7 +20157,7 @@ class PlexMeetsHomeAssistant extends HTMLElement {
playButton.addEventListener('click', event => { playButton.addEventListener('click', event => {
event.stopPropagation(); event.stopPropagation();
if (this.hassObj && this.playController) { if (this.hassObj && this.playController) {
this.playController.play(data, data.type === 'movie'); this.playController.play(data, true);
} }
}); });
const titleElem = document.createElement('div'); const titleElem = document.createElement('div');

@ -505,7 +505,7 @@ class PlexMeetsHomeAssistant extends HTMLElement {
playButton.addEventListener('click', event => { playButton.addEventListener('click', event => {
event.stopPropagation(); event.stopPropagation();
if (this.plex && this.playController) { if (this.plex && this.playController) {
this.playController.play(seasonData); this.playController.play(seasonData, true);
} }
}); });
@ -792,7 +792,7 @@ class PlexMeetsHomeAssistant extends HTMLElement {
event.stopPropagation(); event.stopPropagation();
if (this.hassObj && this.playController) { if (this.hassObj && this.playController) {
this.playController.play(data, data.type === 'movie'); this.playController.play(data, true);
} }
}); });

Loading…
Cancel
Save