diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-04-23 07:51:12 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-04-23 07:51:12 +0000 |
commit | 45250f50194cac99fde9569d8e8fd54ad89db179 (patch) | |
tree | d28b841587f77bdf3f61c16a08d5e7c1559280b8 /stream.php | |
parent | 37607a70f493921c93a50f7d245568a9e8d34d63 (diff) | |
download | ampache-45250f50194cac99fde9569d8e8fd54ad89db179.tar.gz ampache-45250f50194cac99fde9569d8e8fd54ad89db179.tar.bz2 ampache-45250f50194cac99fde9569d8e8fd54ad89db179.zip |
added favorite X play links
Diffstat (limited to 'stream.php')
-rw-r--r-- | stream.php | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -19,7 +19,7 @@ */ -require 'lib/init.php'; +require_once 'lib/init.php'; /* If we are running a demo, quick while you still can! */ if (Config::get('demo_mode') || !$GLOBALS['user']->has_access('25')) { @@ -56,6 +56,24 @@ switch ($action) { $tmp_playlist = new tmpPlaylist($_REQUEST['tmpplaylist_id']); $song_ids = $tmp_playlist->get_items(); break; + case 'play_favorite': + $data = $GLOBALS['user']->get_favorites($_REQUEST['type']); + $song_ids = array(); + switch ($_REQUEST['type']) { + case 'artist': + case 'album': + foreach ($data as $value) { + $songs = $value->get_songs(); + $song_ids = array_merge($song_ids,$songs); + } + break; + case 'song': + foreach ($data as $value) { + $song_ids[] = $value->id; + } + break; + } // end switch on type + break; case 'single_song': $song_ids[] = scrub_in($_REQUEST['song_id']); break; |