diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-07-31 07:22:18 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-07-31 07:22:18 +0000 |
commit | f8c98952aa5a8a30a50160db864217d6bf942a8f (patch) | |
tree | 96e537df58a24cc024a975f8414e3e06aa8fae1d /play/index.php | |
parent | 2148ecc8ac957beb53ac1be3b6d7aafba491b7aa (diff) | |
download | ampache-f8c98952aa5a8a30a50160db864217d6bf942a8f.tar.gz ampache-f8c98952aa5a8a30a50160db864217d6bf942a8f.tar.bz2 ampache-f8c98952aa5a8a30a50160db864217d6bf942a8f.zip |
fixed now playing, hopefully once and for all, added title text to the now playing username that displays the agent they are using to play said song, added distinct sessions and session lengths for each stream instance
Diffstat (limited to 'play/index.php')
-rw-r--r-- | play/index.php | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/play/index.php b/play/index.php index 438db254..cf4d4963 100644 --- a/play/index.php +++ b/play/index.php @@ -73,15 +73,15 @@ if (Config::get('xml_rpc')) { } // If require session is set then we need to make sure we're legit -if (Config::get('require_session') OR $xml_rpc) { - if(!session_exists($sid,$xml_rpc)) { +if (Config::get('require_session')) { + if(!Stream::session_exists($sid)) { debug_event('session_expired',"Streaming Access Denied: " . $GLOBALS['user']->username . "'s session has expired",'3'); die(_("Session Expired: please log in again at") . " " . Config::get('web_path') . "/login.php"); } // Now that we've confirmed the session is valid // extend it - extend_session($sid); + Stream::extend_session($sid,$uid); } @@ -272,7 +272,7 @@ $chunk_size = '4096'; $song->size = $song->size + ($chunk_size*2); // Put this song in the now_playing table -$lastid = insert_now_playing($song->id,$uid,$song->time); +insert_now_playing($song->id,$uid,$song->time,$sid); if ($start) { debug_event('seek','Content-Range header recieved, skipping ahead ' . $start . ' bytes out of ' . $song->size,'5'); @@ -305,9 +305,6 @@ while (!feof($fp) && (connection_status() == 0)) { $bytesStreamed += $chunk_size; } -/* Delete the Now Playing Entry */ -delete_now_playing($lastid); - if ($bytesStreamed > $minBytesStreamed) { $user->update_stats($song->id); /* If this is a voting tmp playlist remove the entry */ |