The issue with picture playlists seems to still exist in the most recent Gotham nightly build.
If I start a picture slideshow from the XBMC UI in a directory that contains pictures and videos, it loops perfectly and plays both videos and photos.
However, if I do a Files.GetDirectory via json-rpc and try to iterate over the array of resulting files adding them to the playlist it appears that video files silently fail. Am I doing something incorrect in my Playlist.Add request? Is it possible to specify the media type to make the video file add requests succeed? It would seem like this must be possible since the XBMC UI can generate a valid picture playlist that contains both picture and video files.
Case 1: Slideshow via playlist from xbmc ui
Playlist.GetItems request
Code:
{"params": {"playlistid": 2}, "jsonrpc": "2.0", "id": 1, "method": "Playlist.GetItems"}
Playlist.GetItems response (as expected)
Code:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"items": [
{
"type": "picture",
"label": "IMG_2314.MOV"
},
{
"type": "picture",
"label": "IMG_2317.jpg"
},
{
"type": "picture",
"label": "IMG_2318.jpg"
},
{
"type": "picture",
"label": "IMG_2319.jpg"
}
],
"limits": {
"start": 0,
"total": 4,
"end": 4
}
}
}
Case 2: Slideshow via playlist from json-rpc
Files.GetDirectory request
Code:
{"params": {"directory": "/Users/xbmc_test"}, "jsonrpc": "2.0", "id": 1, "method": "Files.GetDirectory"}
Files.GetDirectory response
Code:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"files": [
{
"filetype": "file",
"type": "unknown",
"file": "/Users/xbmc_test/IMG_2319.jpg",
"label": "IMG_2319.jpg"
},
{
"filetype": "file",
"type": "unknown",
"file": "/Users/xbmc_test/IMG_2318.jpg",
"label": "IMG_2318.jpg"
},
{
"filetype": "file",
"type": "unknown",
"file": "/Users/xbmc_test/IMG_2317.jpg",
"label": "IMG_2317.jpg"
},
{
"filetype": "file",
"type": "unknown",
"file": "/Users/xbmc_test/IMG_2314.MOV",
"label": "IMG_2314.MOV"
}
],
"limits": {
"start": 0,
"total": 4,
"end": 4
}
}
}
Playlist.Add requests and responses:
Code:
{"params": {"item": {"file": "/Users/xbmc_test/IMG_2319.jpg"}, "playlistid": 2}, "jsonrpc": "2.0", "id": 1, "method": "Playlist.Add"}
{
"jsonrpc": "2.0",
"id": 1,
"result": "OK"
}
{"params": {"item": {"file": "/Users/xbmc_test/IMG_2318.jpg"}, "playlistid": 2}, "jsonrpc": "2.0", "id": 1, "method": "Playlist.Add"}
{
"jsonrpc": "2.0",
"id": 1,
"result": "OK"
}
{"params": {"item": {"file": "/Users/xbmc_test/IMG_2317.jpg"}, "playlistid": 2}, "jsonrpc": "2.0", "id": 1, "method": "Playlist.Add"}
{
"jsonrpc": "2.0",
"id": 1,
"result": "OK"
}
{"params": {"item": {"file": "/Users/xbmc_test/IMG_2314.MOV"}, "playlistid": 2}, "jsonrpc": "2.0", "id": 1, "method": "Playlist.Add"}
{
"jsonrpc": "2.0",
"id": 1,
"result": "OK"
}
Playlist.GetItems request
Code:
{"params": {"playlistid": 2}, "jsonrpc": "2.0", "id": 1, "method": "Playlist.GetItems"}
Playlist.GetItems response
Code:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"items": [
{
"type": "picture",
"label": "IMG_2317.jpg"
},
{
"type": "picture",
"label": "IMG_2319.jpg"
},
{
"type": "picture",
"label": "IMG_2318.jpg"
}
],
"limits": {
"start": 0,
"total": 3,
"end": 3
}
}
}