From 9b89f970638aed2d4d32bf44b5efdfe64535eeac Mon Sep 17 00:00:00 2001 From: Johan Frick Date: Sat, 16 Dec 2023 17:52:47 +0100 Subject: [PATCH] feature: http to https for thumbnails --- src/services/hass-service.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/services/hass-service.ts b/src/services/hass-service.ts index 688118e8..1bf820af 100644 --- a/src/services/hass-service.ts +++ b/src/services/hass-service.ts @@ -36,12 +36,17 @@ export default class HassService { } async browseMedia(mediaPlayer: MediaPlayer, media_content_type?: string, media_content_id?: string) { - return await this.hass.callWS({ + const mediaPlayerItem = await this.hass.callWS({ type: 'media_player/browse_media', entity_id: mediaPlayer.id, media_content_id, media_content_type, }); + mediaPlayerItem.children = mediaPlayerItem.children?.map((child) => ({ + ...child, + thumbnail: child.thumbnail?.replace('http://', 'https://'), + })); + return mediaPlayerItem; } async getRelatedEntities(player: MediaPlayer) {