mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 08:16:36 +00:00
Media Browser: Fix error handling (#7538)
This commit is contained in:
parent
01fe5dd2f7
commit
facb3266c6
@ -540,17 +540,20 @@ export class HaMediaPlayerBrowse extends LitElement {
|
|||||||
mediaContentType?: string
|
mediaContentType?: string
|
||||||
): Promise<MediaPlayerItem> {
|
): Promise<MediaPlayerItem> {
|
||||||
this._loading = true;
|
this._loading = true;
|
||||||
const itemData =
|
let itemData: any;
|
||||||
this.entityId !== BROWSER_PLAYER
|
try {
|
||||||
? await browseMediaPlayer(
|
itemData =
|
||||||
this.hass,
|
this.entityId !== BROWSER_PLAYER
|
||||||
this.entityId,
|
? await browseMediaPlayer(
|
||||||
mediaContentId,
|
this.hass,
|
||||||
mediaContentType
|
this.entityId,
|
||||||
)
|
mediaContentId,
|
||||||
: await browseLocalMediaPlayer(this.hass, mediaContentId);
|
mediaContentType
|
||||||
|
)
|
||||||
this._loading = false;
|
: await browseLocalMediaPlayer(this.hass, mediaContentId);
|
||||||
|
} finally {
|
||||||
|
this._loading = false;
|
||||||
|
}
|
||||||
return itemData;
|
return itemData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user