JSON API responds with "OK" when attempting to play non-existent items
#1
Based on a question from a iOS Remote App user I looked into the following use case which can happen when there inconsistencies in the Kodi database.

The inconsistency is to still have a database entry for a file which does not exist anymore. This can be reached via simply renaming a file which was already scanned to the database. In my case I renamed one of my movie files from "title.mpg" to "_title.mpg".

When I now add the movieid to the playlist the JSON API responds with no error. This still makes sense as for now we are just moving around an id. But when I trigger playback via Player.Open (with the playlist ID and index) I still receive the response "OK" via the JSON API, even though the Kodi UI shows an error because it can obviously not find and play the file.

Wouldn't it make sense to respond with the same error message on UI and JSON API?
Reply
#2
Well....as I understand where you are coming from, the "OK" response is still somewhat correct. As the command is send correctly and the entry is still in the database as you are triggering it via its IP. So what else should the respond be rather than "OK"?

I'm not a developer, but I would guess that the handling of the error message see in the GUI was triggered after the JSON command was correctly sent. So it's probably not the responsibility of the API to answer with something different. 

But it would still be nice to get a similar message via the API and probably react on that
Reply
#3
AFAIK OK from JSON API simply means the JSON was syntactically correct and the method was executed.

scott s.
.
Reply
#4
Hmm, so the API responds with OK, if the command is formatted correctly and an action was triggered. Exception for database queries where the API awaits the results and sends them back. For other commands the API does not. In my opinion it would be helpful if the result of the called action would be reported back.
Reply

Logout Mark Read Team Forum Stats Members Help
JSON API responds with "OK" when attempting to play non-existent items0