bushvin / hass-integrations

My custom Home Assistant integrations
Apache License 2.0
61 stars 11 forks source link

Load Tidal playlists doesn't work #26

Closed marcpaulchand closed 1 year ago

marcpaulchand commented 1 year ago

Hello

First of I don't know if the issue is about this integration or the mopidy-tidal extension(*).

I discovered this with your integration so in order to track my notes i start here.

Expected Situation

I choose a Tidal playlist and play it on mopidy

Actual situation

Mopidy load the right amount of tracks, but with id 0:0:0 and nothing happen.

Workaround

I created a pyscript shared on home assistant forums as workaround.

It acts as 3 steps :

  1. core.playlists.get_items
  2. core.tracklist.add
  3. core.playback.play

I guest you would like more informations. Here are mopidy logs:

May 22 16:45:39 debian mopidy[509]: DEBUG    [MpdFrontend-9] mopidy.listener Sending playlist to MpdSession: {}
May 22 16:45:39 debian mopidy[509]: DEBUG    [HttpServer] mopidy.http.handlers Received RPC message from 10.0.1.17: b'{"jsonrpc": "2.0", "id": 0, "method": "core.tracklist.add", "params": {"uris": ["tidal:playlist:2e151dcc-fa86-405a-9b56-4f4399035c29"]}}'
May 22 16:45:39 debian mopidy[509]: INFO     [TidalBackend-2] mopidy_tidal.library Lookup uris 'tidal:playlist:2e151dcc-fa86-405a-9b56-4f4399035c29'
May 22 16:45:39 debian mopidy[509]: DEBUG    [TidalBackend-2] mopidy_tidal.lru_cache Filesystem cache hit for tidal:playlist:2e151dcc-fa86-405a-9b56-4f4399035c29
May 22 16:45:39 debian mopidy[509]: INFO     [TidalBackend-2] mopidy_tidal.library Returning 25 tracks
May 22 16:45:39 debian mopidy[509]: DEBUG    [Core-6] mopidy.core.tracklist Triggering event: tracklist_changed()
May 22 16:45:39 debian mopidy[509]: DEBUG    [Core-6] mopidy.listener Sending tracklist_changed to CoreListener: {}
May 22 16:45:39 debian mopidy[509]: DEBUG    [MpdFrontend-9] mopidy.listener Sending playlist to MpdSession: {}
May 22 16:45:39 debian mopidy[509]: DEBUG    [HttpServer] mopidy.http.handlers Received RPC message from 10.0.1.17: b'{"jsonrpc": "2.0", "id": 0, "method": "core.playback.play"}'
May 22 16:45:40 debian mopidy[509]: DEBUG    [Audio-1] mopidy.audio.gst Changing state to GST_STATE_READY: result=GST_STATE_CHANGE_SUCCESS
May 22 16:45:40 debian mopidy[509]: INFO     [TidalBackend-2] mopidy_tidal.playback TIDAL uri: tidal:track:0:0:0
May 22 16:45:40 debian mopidy[509]: DEBUG    [MainThread] mopidy.audio.gst Got STATE_CHANGED bus message: old=GST_STATE_NULL new=GST_STATE_READY pending=GST_STATE_VOID_PENDING
May 22 16:45:40 debian mopidy[509]: WARNING  [TidalBackend-2] tidalapi.request HTTP error on 404
May 22 16:45:40 debian mopidy[509]: ERROR    [Core-6] mopidy.core.playback TidalBackend backend caused an exception.

As you can see it get tidal:playlist:2e151dcc-fa86-405a-9b56-4f4399035c29 (nirvana essentials) It found 25 tracks. They're added but with the following uri : "tidal:track:0:0:0"

Note

* : I tried with an other mopidy client(M.AL.P on android), and i can load a playlist without issue. So i doubt mopidy-tidal is in cause.

edit: add note

bushvin commented 1 year ago

Hi @marcpaulchand

The mopidy API is not 100% compatible with HA integrations out-of-the-box, it needs some love to display everything correctly.

Thank you for raising this mopidy extension to my attention, I will definitely look into it later this week, and try to come up with a solution.

marcpaulchand commented 1 year ago

Thanks for your quick answer.

Between you and me just be able to get the record cover is a thing !

Let me know if you need an account i'll be happy to help.

bushvin commented 1 year ago

Let me know if you need an account i'll be happy to help.

Thanks, but I have one myself. I just never got around adding Tidal support due to way too many things to do, like everyone else ;)

bushvin commented 1 year ago

@marcpaulchand I believe I got it fixed, can you try?

Here's the updated code: https://github.com/bushvin/hass-integrations/tree/feature/tidal

Will create a release after testing spotify playlists as well

marcpaulchand commented 1 year ago

Hi @bushvin : Great work.

From my point of view tidal playlists are working ! I let you check for spotify i don't use this one.

Thanks a lot.

Bests.

marcpaulchand commented 1 year ago

Everything's fine !

And now it's closed