|
|
@ -19510,7 +19510,7 @@ class PlayController {
|
|
|
|
await this.playViaKodi(entity.value, data, data.type);
|
|
|
|
await this.playViaKodi(entity.value, data, data.type);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'vlcTelnet':
|
|
|
|
case 'vlcTelnet':
|
|
|
|
await this.playViaVLCTelnet(entity.value, data.Media[0].Part[0].key, data.type);
|
|
|
|
await this.playViaVLCTelnet(entity.value, data, data.type);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'androidtv':
|
|
|
|
case 'androidtv':
|
|
|
|
if (lodash.isEqual(data.type, 'epg')) {
|
|
|
|
if (lodash.isEqual(data.type, 'epg')) {
|
|
|
@ -19617,8 +19617,8 @@ class PlayController {
|
|
|
|
await this.hass.callService(this.runAfter[0], this.runAfter[1], {});
|
|
|
|
await this.hass.callService(this.runAfter[0], this.runAfter[1], {});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
this.plexPlayerCreateQueue = async (movieID, plex) => {
|
|
|
|
this.plexPlayerCreateQueue = async (key, plex, type, shuffle = false, repeat = false, continuous = false) => {
|
|
|
|
const url = `${plex.getBasicURL()}/playQueues?type=video&shuffle=0&repeat=0&continuous=1&own=1&uri=server://${await plex.getServerID()}/com.plexapp.plugins.library/library/metadata/${movieID}`;
|
|
|
|
const url = `${plex.getBasicURL()}/playQueues?type=${type}&shuffle=${shuffle ? '1' : '0'}&repeat=${repeat ? '1' : '0'}&continuous=${continuous ? '1' : '0'}&own=1&uri=server://${await plex.getServerID()}/com.plexapp.plugins.library${key}`;
|
|
|
|
const plexResponse = await axios({
|
|
|
|
const plexResponse = await axios({
|
|
|
|
method: 'post',
|
|
|
|
method: 'post',
|
|
|
|
url,
|
|
|
|
url,
|
|
|
@ -19641,7 +19641,7 @@ class PlayController {
|
|
|
|
if (lodash.isObject(entity) && !lodash.isNil(entity.plex)) {
|
|
|
|
if (lodash.isObject(entity) && !lodash.isNil(entity.plex)) {
|
|
|
|
plex = entity.plex;
|
|
|
|
plex = entity.plex;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const { playQueueID, playQueueSelectedMetadataItemID } = await this.plexPlayerCreateQueue(movieID, this.plex);
|
|
|
|
const { playQueueID, playQueueSelectedMetadataItemID } = await this.plexPlayerCreateQueue(`/library/metadata/${movieID}`, this.plex, 'video');
|
|
|
|
let url = plex.getBasicURL();
|
|
|
|
let url = plex.getBasicURL();
|
|
|
|
url += `/player/playback/playMedia`;
|
|
|
|
url += `/player/playback/playMedia`;
|
|
|
|
url += `?type=video`;
|
|
|
|
url += `?type=video`;
|
|
|
@ -19756,7 +19756,7 @@ class PlayController {
|
|
|
|
throw Error(`Plex type ${type} is not supported in Kodi.`);
|
|
|
|
throw Error(`Plex type ${type} is not supported in Kodi.`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
this.playViaVLCTelnet = async (entityName, mediaLink, type) => {
|
|
|
|
this.playViaVLCTelnet = async (entityName, data, type) => {
|
|
|
|
switch (type) {
|
|
|
|
switch (type) {
|
|
|
|
case 'track':
|
|
|
|
case 'track':
|
|
|
|
this.hass.callService('media_player', 'play_media', {
|
|
|
|
this.hass.callService('media_player', 'play_media', {
|
|
|
@ -19765,7 +19765,7 @@ class PlayController {
|
|
|
|
// eslint-disable-next-line @typescript-eslint/camelcase
|
|
|
|
// eslint-disable-next-line @typescript-eslint/camelcase
|
|
|
|
media_content_type: 'music',
|
|
|
|
media_content_type: 'music',
|
|
|
|
// eslint-disable-next-line @typescript-eslint/camelcase
|
|
|
|
// eslint-disable-next-line @typescript-eslint/camelcase
|
|
|
|
media_content_id: this.plex.authorizeURL(`${this.plex.getBasicURL()}${mediaLink}`)
|
|
|
|
media_content_id: this.plex.authorizeURL(`${this.plex.getBasicURL()}${data.Media[0].Part[0].key}`)
|
|
|
|
});
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|