mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 15:26: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
|
||||
): Promise<MediaPlayerItem> {
|
||||
this._loading = true;
|
||||
const itemData =
|
||||
this.entityId !== BROWSER_PLAYER
|
||||
? await browseMediaPlayer(
|
||||
this.hass,
|
||||
this.entityId,
|
||||
mediaContentId,
|
||||
mediaContentType
|
||||
)
|
||||
: await browseLocalMediaPlayer(this.hass, mediaContentId);
|
||||
|
||||
this._loading = false;
|
||||
let itemData: any;
|
||||
try {
|
||||
itemData =
|
||||
this.entityId !== BROWSER_PLAYER
|
||||
? await browseMediaPlayer(
|
||||
this.hass,
|
||||
this.entityId,
|
||||
mediaContentId,
|
||||
mediaContentType
|
||||
)
|
||||
: await browseLocalMediaPlayer(this.hass, mediaContentId);
|
||||
} finally {
|
||||
this._loading = false;
|
||||
}
|
||||
return itemData;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user