summaryrefslogtreecommitdiffstats
path: root/modules/localplay/mpd.controller.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-04-09 07:55:50 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-04-09 07:55:50 +0000
commit5aeac3b17e31d0cc88321a614469c4f3f1a9c0dc (patch)
treeff7ceb1767ce45ab9dc9e5e192ed36bc69e3db90 /modules/localplay/mpd.controller.php
parent79a890b7bf7bd9b31e6879c64d5651cef02975f3 (diff)
downloadampache-5aeac3b17e31d0cc88321a614469c4f3f1a9c0dc.tar.gz
ampache-5aeac3b17e31d0cc88321a614469c4f3f1a9c0dc.tar.bz2
ampache-5aeac3b17e31d0cc88321a614469c4f3f1a9c0dc.zip
added an ugly localplay view page, and made it so you can remove songs from your mpd playlist... its ugly.. I know.. ooh yea you can also deactivate modules now
Diffstat (limited to 'modules/localplay/mpd.controller.php')
-rw-r--r--modules/localplay/mpd.controller.php20
1 files changed, 16 insertions, 4 deletions
diff --git a/modules/localplay/mpd.controller.php b/modules/localplay/mpd.controller.php
index 991d778a..b7b461ed 100644
--- a/modules/localplay/mpd.controller.php
+++ b/modules/localplay/mpd.controller.php
@@ -75,6 +75,7 @@ class AmpacheMpd {
/* Optional Functions */
$map['move'] = 'move';
+ //$map['delete_all'] = 'clear_playlist';
return $map;
@@ -263,21 +264,32 @@ class AmpacheMpd {
/* Get the Current Playlist */
$playlist = $this->_mpd->playlist;
-
+
foreach ($playlist as $entry) {
$data = array();
/* Required Elements */
$data['id'] = $entry['Pos'];
- $data['raw'] = $entry['file'];
+ $data['raw'] = $entry['file'];
+
+ /* Parse out the song ID and then create the song object */
+ preg_match("/song=(\d+)\&/",$entry['file'],$matches);
+
+ $song = new Song($matches['1']);
+ $song->format_song();
+ $data['name'] = $song->f_title . ' - ' . $song->f_album . ' - ' . $song->f_artist;
+
+ /* Just incase prevent emtpy names */
+ if (!$song->title) { $data['name'] = _('Unknown'); }
/* Optional Elements */
- $data['name'] = '';
+ $data['link'] = '';
+ $data['track'] = $entry['Pos'];
$results[] = $data;
} // foreach playlist items
-
+
return $results;
} // get_songs