Add: Alert if movie/tvshow is not found in kodi

pull/16/head
Juraj Nyíri 3 years ago
parent 74fe0bae96
commit e0fb641224

@ -18775,6 +18775,8 @@ class PlayController {
} }
}); });
if (lodash.isEmpty(foundResult)) { if (lodash.isEmpty(foundResult)) {
// eslint-disable-next-line no-alert
alert(`Title ${search} not found in Kodi.`);
throw Error(`Title ${search} not found in Kodi.`); throw Error(`Title ${search} not found in Kodi.`);
} }
return foundResult; return foundResult;

@ -1,5 +1,6 @@
/* eslint-disable consistent-return */ /* eslint-disable consistent-return */
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-env browser */
import { HomeAssistant } from 'custom-card-helpers'; import { HomeAssistant } from 'custom-card-helpers';
import _ from 'lodash'; import _ from 'lodash';
import axios from 'axios'; import axios from 'axios';
@ -51,6 +52,8 @@ class PlayController {
} }
}); });
if (_.isEmpty(foundResult)) { if (_.isEmpty(foundResult)) {
// eslint-disable-next-line no-alert
alert(`Title ${search} not found in Kodi.`);
throw Error(`Title ${search} not found in Kodi.`); throw Error(`Title ${search} not found in Kodi.`);
} }
return foundResult; return foundResult;

Loading…
Cancel
Save