kalkih / mini-media-player

Minimalistic media card for Home Assistant Lovelace UI
MIT License
1.53k stars 207 forks source link

playlist shortcut type does not support user specific playlist like Mix Tapes or Discovery Weekly #497

Closed Clusters closed 3 years ago

Clusters commented 3 years ago

Isn't it possible to replay user specific playlists like the mix tapes or the discovery weekly playlist? The weekly playlist is even selectable via the spotify media player. The mix tapes are missing there too though.

I was not able to find any existing issues to address this, so I wonder if I'm doing something wrong here.

  - icon: 'mdi:beach'
    type: playlist
    id: 'spotify:user:MYUSERID:playlist:4MGMq5a7k7XLTvo0PkYEH1' # custom playlist -> working
  - icon: 'mdi:feature-search'
    type: playlist
    id: 'spotify:user:MYUSERID:playlist:37i9dQZEVXcTvyRUPhGD5D' # discovery weekly playlist -> not working

If this is a known limitation. Do you have any script or automation examples on how to copy the discovery weekly playlist to a custom one? If I recall correctly, this was possible within IFTTT?

kongo09 commented 3 years ago

You should be able to start the Discover Weekly playlist by calling a service like this:

service: media_player.play_media
data:
  media_content_id: '{{ playlist_id }}'
  media_content_type: playlist
entity_id: media_player.spotify

Replace {{ playlist_id }} with your personal link to your Discover Weekly playlist, something like

https://open.spotify.com/playlist/37i9dQZEVXcTvyRUPhGD5D

So something like this should work:


- entity: media_player.spotify
  type: custom:mini-media-player
  artwork: cover
  source: icon
  hide:
    volume: true
  shortcuts:
    columns: 1
    buttons:
      - name: Discover Weekly
        type: service
        id: media_player.play_media
        data:
          entity_id: media_player.spotify
          media_content_id: 'https://open.spotify.com/playlist/37i9dQZEVXcTvyRUPhGD5D'
          media_content_type: playlist
kalkih commented 3 years ago

@kongo09 Thanks for sharing.

If that works, you should also be able to specify it directly in a shortcut since that relies on media_player.play_media in the background.

e.g.

  - icon: 'mdi:feature-search'
    type: playlist
    id: 'https://open.spotify.com/playlist/37i9dQZEVXcTvyRUPhGD5D'