2012-06-28, 23:57
Using the following command to retrieve all songs from xbmc I get invalid track numbers for some mp3 files. The problem seems to occur every time the "disc number" is set in the id3 tag. Other thing I spotted is that the rating is displayed as ascii value instead of an int.
Is there a way to retrieve the correct track number from the value (65540 instead of 4) that is returned from xbmc since I would like to make it work with xbmc eden?
EDIT: looks actually that I can retrieve the track number by using "track modulo 65536" and "track / 65536" to retrieve the disc number
Is there a way to retrieve the correct track number from the value (65540 instead of 4) that is returned from xbmc since I would like to make it work with xbmc eden?
Code:
curl -H "Content-Type: application/json" -d "{\"jsonrpc\": \"2.0\", \"method\": \"AudioLibrary.GetSongs\", \"params\" : { \"properties\" : [\"title\", \"artist\", \"genre\", \"album\", \"track\", \"thumbnail\", \"file\", \"duration\", \"rating\"] }, \"id\" : 1 }" http://10.0.0.136:8080/jsonrpc | python -mjson.tool
Code:
{
"album": "Write About Love",
"artist": "Belle and Sebastian",
"duration": 273,
"file": "/home/xbmc/Music/new/Belle and Sebastian - I Want the World to Stop.mp3",
"genre": "Indie",
"label": "I Want the World to Stop",
"rating": 48,
"songid": 18,
"thumbnail": "special://masterprofile/Thumbnails/Music/2/22e91d13.tbn",
"title": "I Want the World to Stop",
"track": 65540
},
EDIT: looks actually that I can retrieve the track number by using "track modulo 65536" and "track / 65536" to retrieve the disc number