Minor media player initialization fix.
This commit is contained in:
@@ -62,7 +62,7 @@ const MOTIONEYE_REPL_SUBSTITUTIONS: Record<string, string> = {
|
|||||||
'%d': 'dd',
|
'%d': 'dd',
|
||||||
'%H': 'HH',
|
'%H': 'HH',
|
||||||
'%M': 'mm',
|
'%M': 'mm',
|
||||||
'%S': 'SS',
|
'%S': 'ss',
|
||||||
};
|
};
|
||||||
const MOTIONEYE_REPL_REGEXP = new RegExp(/(%Y|%m|%d|%H|%M|%S)/g);
|
const MOTIONEYE_REPL_REGEXP = new RegExp(/(%Y|%m|%d|%H|%M|%S)/g);
|
||||||
|
|
||||||
|
|||||||
+8
-8
@@ -1218,21 +1218,21 @@ class FrigateCard extends LitElement {
|
|||||||
* @returns `true` if card rendering can continue.
|
* @returns `true` if card rendering can continue.
|
||||||
*/
|
*/
|
||||||
protected _initializeBackground(): void {
|
protected _initializeBackground(): void {
|
||||||
if (this._initializer.isInitialized(InitializationAspect.MEDIA_PLAYERS)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const hass = this._hass;
|
const hass = this._hass;
|
||||||
const config = this._getConfig();
|
const config = this._getConfig();
|
||||||
if (!hass || !config) {
|
const needMediaPlayers = config.menu.buttons.media_player.enabled;
|
||||||
|
if (!hass || !config || !needMediaPlayers) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this._initializer.isInitialized(InitializationAspect.MEDIA_PLAYERS)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._initializer
|
this._initializer
|
||||||
.initializeMultipleIfNecessary({
|
.initializeMultipleIfNecessary({
|
||||||
...(config.menu.buttons.media_player.enabled && {
|
[InitializationAspect.MEDIA_PLAYERS]: async () =>
|
||||||
[InitializationAspect.MEDIA_PLAYERS]: async () =>
|
await this._initializeMediaPlayers(hass),
|
||||||
await this._initializeMediaPlayers(hass),
|
|
||||||
}),
|
|
||||||
})
|
})
|
||||||
.then((initialized) => {
|
.then((initialized) => {
|
||||||
if (initialized) {
|
if (initialized) {
|
||||||
|
|||||||
Reference in New Issue
Block a user