diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-09-28 02:18:08 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-09-28 02:18:08 +0000 |
commit | 705fba8f49faa42ed7f004f67b74a996c29ddb3d (patch) | |
tree | e6409a5c1f9106a03e0abbb13cdb92e9c1a0968a /lib/class/stream.class.php | |
parent | 9030c16466ec16db505d755d9b6405b5a40c897d (diff) | |
download | ampache-705fba8f49faa42ed7f004f67b74a996c29ddb3d.tar.gz ampache-705fba8f49faa42ed7f004f67b74a996c29ddb3d.tar.bz2 ampache-705fba8f49faa42ed7f004f67b74a996c29ddb3d.zip |
ajax loading thingy added to css, fixed random methods on rightbar and added a default sort to the browse methods
Diffstat (limited to 'lib/class/stream.class.php')
-rw-r--r-- | lib/class/stream.class.php | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/lib/class/stream.class.php b/lib/class/stream.class.php index 7c07b8f3..ffd4be6f 100644 --- a/lib/class/stream.class.php +++ b/lib/class/stream.class.php @@ -53,9 +53,6 @@ class Stream { if (Config::get('force_http_play')) { $this->web_path = preg_replace("/https/", "http",$this->web_path); } - - // Generate the session ID - self::$session = md5(uniqid(rand(), true));; } // Constructor @@ -104,6 +101,16 @@ class Stream { } // manual_url_add /** + * get_session + * This returns the current stream session + */ + public static function get_session() { + + return self::$session; + + } // get_session + + /** * insert_session * This inserts a row into the session_stream table */ @@ -207,7 +214,7 @@ class Stream { if ($GLOBALS['user']->prefs['play_type'] == 'downsample') { $ds = $GLOBALS['user']->prefs['sample_rate']; } - echo $song->get_url(self::$session); + echo $song->get_url(); } // end foreach /* Foreach the additional URLs */ @@ -443,7 +450,7 @@ class Stream { // Foreach the stuff we've got and add it foreach ($this->objects as $object) { - $localplay->add($object,self::$session); + $localplay->add($object); } $localplay->play(); @@ -474,7 +481,7 @@ class Stream { // Build up our object $song_id = $this->songs['0']; $song = new Song($song_id); - $url = $song->get_url(self::$session); + $url = $song->get_url(); // Append the fact we are downloading $url .= '&action=download'; @@ -496,11 +503,22 @@ class Stream { header("Content-Type: audio/x-pn-realaudio ram;"); foreach ($this->songs as $song_id) { $song = new Song($song_id); - echo $song->get_url(self::$session); + echo $song->get_url(); } // foreach songs } // create_ram + /** + * auto_init + * This is called on class load it sets the session + */ + public static function auto_init() { + + // Generate the session ID + self::$session = md5(uniqid(rand(), true));; + + } // auto_init + } //end of stream class ?> |