Skip to content

Commit

Permalink
feature: http to https for thumbnails
Browse files Browse the repository at this point in the history
  • Loading branch information
punxaphil committed Dec 17, 2023
1 parent 5d45ff5 commit 9b89f97
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/services/hass-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<MediaPlayerItem>({
const mediaPlayerItem = await this.hass.callWS<MediaPlayerItem>({
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) {
Expand Down

0 comments on commit 9b89f97

Please sign in to comment.