Permalink
Browse files

fix play song from list with xbmc trunk

  • Loading branch information...
1 parent 16ff12f commit 1615a1635aff60102bd3fa790710cb46e37839e1 nick8888 committed Jun 21, 2011
Showing with 7 additions and 1 deletion.
  1. +6 −1 widgets/libXBMCLibrary.php
  2. +1 −0 xbmcjsonlib.php
@@ -422,7 +422,12 @@ function playSongFromList($songid) {
if ($results['result']['audio'] == 1) {
$request = jsonstring("AudioPlaylist.Add", $songid);
} else {
- $request = jsonstring("XBMC.Play", '"songid": '.$songid);
+ if($jsonVersion['result']['version'] == '2') { $request = jsonstring("XBMC.Play", '"songid": '.$songid); }
+ if($jsonVersion['result']['version'] == '3')
+ {
+ jsoncall("AudioPlaylist.Clear";
+ jsoncall(jsonstring("AudioPlaylist.Add", $songid));
+ }
}
$results = jsoncall($request);
if (empty($results)) {
View
@@ -43,6 +43,7 @@
//AudioPlaylist
'AudioPlaylist.Add' => array('call' => '{"jsonrpc": "2.0", "method": "AudioPlaylist.Add", "params": { "songid" : %d }, "id": 1}',
'args' => '0'),
+ 'AudioPlaylist.Clear' => array('call' => '{"jsonrpc": "2.0", "method": "AudioPlaylist.Clear", "id": 1}'),
'AudioPlaylist.GetItems' => array('call' => '{"jsonrpc": "2.0", "method": "AudioPlaylist.GetItems", "params": { "fields": ["title", "album", "artist", "duration"] }, "id": 1}'),
'AudioPlaylist.SkipPrevious' => array('call' => '{"jsonrpc": "2.0", "method": "AudioPlaylist.SkipPrevious", "id": 1}'),
'AudioPlaylist.SkipNext' => array('call' => '{"jsonrpc": "2.0", "method": "AudioPlaylist.SkipNext", "id": 1}'),

0 comments on commit 1615a16

Please sign in to comment.