|
|
|
@ -18830,7 +18830,7 @@ class Plex {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class PlayController {
|
|
|
|
|
constructor(hass, plex, entity, runBefore, runAfter, libraryName) {
|
|
|
|
|
constructor(hass, plex, entity, runBefore, runAfter) {
|
|
|
|
|
this.plexPlayerEntity = '';
|
|
|
|
|
this.runBefore = false;
|
|
|
|
|
this.runAfter = false;
|
|
|
|
@ -18913,14 +18913,14 @@ class PlayController {
|
|
|
|
|
case 'movie':
|
|
|
|
|
this.playViaCastPlex(entity.value, 'movie', `plex://${JSON.stringify({
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/camelcase
|
|
|
|
|
library_name: this.libraryName,
|
|
|
|
|
library_name: data.librarySectionTitle,
|
|
|
|
|
title: data.title
|
|
|
|
|
})}`);
|
|
|
|
|
break;
|
|
|
|
|
case 'episode':
|
|
|
|
|
this.playViaCastPlex(entity.value, 'EPISODE', `plex://${JSON.stringify({
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/camelcase
|
|
|
|
|
library_name: this.libraryName,
|
|
|
|
|
library_name: data.librarySectionTitle,
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/camelcase
|
|
|
|
|
show_name: data.grandparentTitle,
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/camelcase
|
|
|
|
@ -19229,7 +19229,6 @@ class PlayController {
|
|
|
|
|
this.hass = hass;
|
|
|
|
|
this.plex = plex;
|
|
|
|
|
this.entity = entity;
|
|
|
|
|
this.libraryName = libraryName;
|
|
|
|
|
if (!lodash.isEmpty(runBefore) && this.hass.states[runBefore]) {
|
|
|
|
|
this.runBefore = runBefore.split('.');
|
|
|
|
|
}
|
|
|
|
@ -20308,7 +20307,7 @@ class PlexMeetsHomeAssistant extends HTMLElement {
|
|
|
|
|
try {
|
|
|
|
|
if (this.plex) {
|
|
|
|
|
if (this.hassObj) {
|
|
|
|
|
this.playController = new PlayController(this.hassObj, this.plex, entity, this.runBefore, this.runAfter, this.config.libraryName);
|
|
|
|
|
this.playController = new PlayController(this.hassObj, this.plex, entity, this.runBefore, this.runAfter);
|
|
|
|
|
if (this.playController) {
|
|
|
|
|
await this.playController.init();
|
|
|
|
|
}
|
|
|
|
|