|
|
@ -185,9 +185,21 @@ class PlayController {
|
|
|
|
if (_.includes(err.message, '404')) {
|
|
|
|
if (_.includes(err.message, '404')) {
|
|
|
|
throw Error('Defined plexPlayer is currently not available for playback.');
|
|
|
|
throw Error('Defined plexPlayer is currently not available for playback.');
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// if we caught CORS error, try to use workaround. Todo: figure out why is the CORS issue happening
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
await this.hass.callService('rest_command', 'pmha_playmedia', {
|
|
|
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/camelcase
|
|
|
|
|
|
|
|
url,
|
|
|
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/camelcase
|
|
|
|
|
|
|
|
target_client_identifier: machineID,
|
|
|
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/camelcase
|
|
|
|
|
|
|
|
client_identifier: 'PlexMeetsHomeAssistant'
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} catch (homeAssistantErr) {
|
|
|
|
throw err;
|
|
|
|
throw err;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
private playViaKodi = async (entityName: string, data: Record<string, any>, type: string): Promise<void> => {
|
|
|
|
private playViaKodi = async (entityName: string, data: Record<string, any>, type: string): Promise<void> => {
|
|
|
|