pimusicbox / mopidy-musicbox-webclient

Web Client for Mopidy Music Server and the Pi MusicBox
https://www.pimusicbox.com
Apache License 2.0
399 stars 106 forks source link

musicbox-webclient sends null/undefined to lookup in mopidy #213

Closed maweki closed 7 years ago

maweki commented 7 years ago

So I am running mopidy 2.0.1 and the current version of the musicbox-webclient from pip (it would be nice if there was a way to see the version somewhere, maybe a meta-tag).

I have a few files from the local provider. If I search for one, and then say "Search for Artist", the following shows up in the mopidy debug stream:

Received WebSocket message from 192.168.1.11: u'{"method":"core.library.lookup","params":{"uris":["undefined"]},"jsonrpc":"2.0","id":58}

If I want to show the album the following happens: Received WebSocket message from 192.168.1.11: u'{"method":"core.library.lookup","params":{"uris":[null]},"jsonrpc":"2.0","id":38}'

Even though Album Name and Artist Name show up correctly:

bildschirmfoto von 2016-11-25 17-55-54

maweki commented 7 years ago

bildschirmfoto von 2016-11-25 18-01-13

That seems like one of the problems

jcass77 commented 7 years ago

I'm not sure I follow what the exact sequence of steps are to reproduce this issue.

Could you elaborate on what is meant with:

If I search for one, and then say "Search for Artist"

What happens if you click on the 'Show Album...' or 'Show Artist...' links in the queue popup menu? Does the problem only occur when searching, or also if you browse to the track and then open the popup menu?

maweki commented 7 years ago

What happens if you click on the 'Show Album...' or 'Show Artist...' links in the queue popup menu?

The UI is stuck until you do something else.

I solved it and apparently the webclient doesn't work with the json local backend and only with the sqlite backend. If you use the json-backend, any "Show Album" and "Show Artist" send empty urls to the mopidy-interface, which results in an errormessage in response that results in the UI being stuck.

I think if the artist/album url are undefined/null then the "show Album"/"Show Artist" buttons shouldn't be there or of there's a way to check which local-plugin is in use, it would be nice to show somewhere, that the json-variant is not fully supported.

jcass77 commented 7 years ago

I've taken a quick glance at the code and it looks like, when doing mopidy local scan, Mopidy will retrieve the tag containing the artist and album names from the relevant audio file.

This is what is available as part of the built-in json local backend.

mopidy-local-sqlite, on the other hand, appears to do some additional lookups when searching for tracks that then also ads the URI of the relevant artist or album to the track.

As far as I know, the Mopidy project intends to switch to mopidy-local-sqlite as the standard local back-end at some point, so until then we can probably just hide the 'Show....' links in the popup if the URI's are not provided by the backend.