API call for current song cover #555
-
myMPD version: [8.0.4] Just updated to the new version! Thank you very much for the great work. After I could implement a few instances, which are quite working good. But I have a problem with API call of the cover image: I call the cover image with following code:
The problem is, the answer of the API call is unfortunately with some signs I didn't expect:
How to remove the "[" and "]" signs? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
result.images is an array of all images myMPD has found.
But it’s easier: |
Beta Was this translation helpful? Give feedback.
-
Thank you, it is working now with this call: URI=$(curl -s -k http://IP:PORT/api/ -d'{"jsonrpc":"2.0","id":0,"method":"MYMPD_API_PLAYER_CURRENT_SONG","params":{}}' | jq -r ".result.images | .[]") Unfortunately I'm not so familiar with API calls, how would the simple was be? In the API documentation I couldn't find something about "song uri". |
Beta Was this translation helpful? Give feedback.
-
MYMPD_API_PLAYER_CURRENT_SONG should return the song uri. Use this uri and prepend /albumart/ |
Beta Was this translation helpful? Give feedback.
-
Yes you are right, but the song-uri has as extension the file type like .m4a/.mp3 etc. -> with that I can't deal, I need the path to the cover image. But doesn't matter, it seems to work. |
Beta Was this translation helpful? Give feedback.
#557 (reply in thread)