summaryrefslogtreecommitdiffstats
path: root/server/playlist.ajax.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-09-27 05:42:11 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-09-27 05:42:11 +0000
commitb4de052e938ef72f828be0da6323fad80479a916 (patch)
tree4bb88ac109d0725856d6c064a869308b3ea58deb /server/playlist.ajax.php
parentf9a3cf50e36c674eeff0d9f2f2682ac69bb03008 (diff)
downloadampache-b4de052e938ef72f828be0da6323fad80479a916.tar.gz
ampache-b4de052e938ef72f828be0da6323fad80479a916.tar.bz2
ampache-b4de052e938ef72f828be0da6323fad80479a916.zip
added ability to append to playlists
Diffstat (limited to 'server/playlist.ajax.php')
-rw-r--r--server/playlist.ajax.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/server/playlist.ajax.php b/server/playlist.ajax.php
index 158e7fe2..ac804f57 100644
--- a/server/playlist.ajax.php
+++ b/server/playlist.ajax.php
@@ -65,6 +65,34 @@ switch ($_REQUEST['action']) {
$results['content'] = ob_get_contents();
ob_end_clean();
break;
+ case 'append':
+ // Pull the current active playlist items
+ $objects = $GLOBALS['user']->playlist->get_items();
+
+ // Create the playlist object
+ $playlist = new Playlist($_REQUEST['playlist_id']);
+
+ // We need to make sure that they have access
+ if (!$playlist->has_access()) {
+ break;
+ }
+
+ // Itterate through and add them to our new playlist
+ foreach ($objects as $uid=>$object_data) {
+ // For now only allow songs on here, we'll change this later
+ if ($object_data['1'] == 'song') {
+ $songs[] = $object_data['0'];
+ }
+ } // foreach
+
+ // Add our new songs
+ $playlist->add_songs($songs);
+ $playlist->format();
+ ob_start();
+ require_once Config::get('prefix') . '/templates/show_playlist.inc.php';
+ $results['content'] = ob_get_contents();
+ ob_end_clean();
+ break;
default:
$results['rfc3514'] = '0x1';
break;