summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorinfamy <infamy@ampache>2006-05-15 16:52:23 +0000
committerinfamy <infamy@ampache>2006-05-15 16:52:23 +0000
commit8046e377bcb7a83b8966e7a2809b905071f7f08a (patch)
treef08c86ac4a84655e963180624f89be6cdf464bc6
parent78f131500e7033bd16936377c57869be42a82088 (diff)
downloadampache-8046e377bcb7a83b8966e7a2809b905071f7f08a.tar.gz
ampache-8046e377bcb7a83b8966e7a2809b905071f7f08a.tar.bz2
ampache-8046e377bcb7a83b8966e7a2809b905071f7f08a.zip
updated xbmc controller delete and clear playlist now work
-rw-r--r--modules/localplay/xbmc.controller.php20
1 files changed, 16 insertions, 4 deletions
diff --git a/modules/localplay/xbmc.controller.php b/modules/localplay/xbmc.controller.php
index e8c3b24b..b80b1910 100644
--- a/modules/localplay/xbmc.controller.php
+++ b/modules/localplay/xbmc.controller.php
@@ -49,7 +49,7 @@ class AmpacheXBMC {
/* Required Functions */
$map['add'] = 'add_songs'; //done
- $map['delete'] = 'delete_songs';
+ $map['delete'] = 'delete_songs'; //done
$map['play'] = 'play'; //done
$map['stop'] = 'stop'; //done
$map['get'] = 'get_songs';
@@ -200,9 +200,21 @@ class AmpacheXBMC {
* the songs, then however ya'll have stored them
* in this controller
*/
- foreach ($songs as $uid) {
+
+ //RemoveFromPlaylist
+ foreach ($songs as $song_id) {
- if (is_null($this->_mpd->PLRemove($uid))) { $return = false; }
+ $song = new Song($song_id);
+
+ $url = conf('localplay_xbmc_smbpath') . $song->get_rel_path();
+
+ $ret = $this->XBMCCmd("RemoveFromPlaylist",urlencode($url . ";0"));
+
+ if ($ret != "OK") {
+ $return = false;
+ debug_event('xbmc_del','Error: Unable to del $url from xbmc ' . $ret,'1');
+ }
+
} // foreach of songs
@@ -299,7 +311,7 @@ class AmpacheXBMC {
*/
function clear_playlist() {
- if ($this->XBMCCmd("clearplaylist","1")!="OK") { return false; }
+ if ($this->XBMCCmd("clearplaylist","0")!="OK") { return false; }
return true;
} // clear_playlist