diff options
Diffstat (limited to 'lib/class')
-rw-r--r-- | lib/class/scrobbler.class.php | 8 | ||||
-rw-r--r-- | lib/class/user.class.php | 31 |
2 files changed, 8 insertions, 31 deletions
diff --git a/lib/class/scrobbler.class.php b/lib/class/scrobbler.class.php index 8b8ca5a7..ad379940 100644 --- a/lib/class/scrobbler.class.php +++ b/lib/class/scrobbler.class.php @@ -112,16 +112,16 @@ class scrobbler { } if(preg_match('/http:\/\/(.*):(\d+)(.*)/', $response[2], $matches)) { - $_SESSION['state']['lastfm']['submit_host'] = $matches[1]; - $_SESSION['state']['lastfm']['submit_port'] = $matches[2]; - $_SESSION['state']['lastfm']['submit_url'] = $matches[3]; + $data['submit_host'] = $matches[1]; + $data['submit_port'] = $matches[2]; + $data['submit_url'] = $matches[3]; } else { $this->error_msg = 'Invalid POST URL returned, unable to continue'; return false; } $this->challenge = $response[1]; - return true; + return $data; } // handshake diff --git a/lib/class/user.class.php b/lib/class/user.class.php index dce54353..8cb28513 100644 --- a/lib/class/user.class.php +++ b/lib/class/user.class.php @@ -574,13 +574,11 @@ class User { if (!empty($this->prefs['lastfm_user']) AND !empty($this->prefs['lastfm_pass'])) { $song_info->format(); - // We're also going to need the session here - $data = $this->get_newest_session(); - + $lastfm = new scrobbler($this->prefs['lastfm_user'],$this->prefs['lastfm_pass']); - $lastfm->submit_host = $data['state']['lastfm']['submit_host']; - $lastfm->submit_port = $data['state']['lastfm']['submit_port']; - $lastfm->submit_url = $data['state']['lastfm']['submit_url']; + $lastfm->submit_host = $this->prefs['lastfm_host']; + $lastfm->submit_port = $this->prefs['lastfm_port']; + $lastfm->submit_url = $this->prefs['lastfm_url']; if (!$lastfm->queue_track($song_info->f_artist_full,$song_info->f_album_full,$song_info->title,time(),$song_info->time)) { debug_event('LastFM','Error: Queue Failed: ' . $lastfm->error_msg,'3'); @@ -1119,27 +1117,6 @@ class User { } // rebuild_all_preferences - /** - * get_newest_session - * This will find the latest active session for this user and return an array from the serialized value - */ - public function get_newest_session() { - - $username = Dba::escape($this->username); - $time = time(); - - $sql = "SELECT `value` FROM `session` WHERE `username`='$username' AND `expire` > '$time' ORDER BY `expire` DESC"; - $db_results = Dba::query($sql); - - $row = Dba::fetch_assoc($db_results); - $string = trim($row['value']); - - $value = unseralize($string); - - return $value; - - } // get_newest_session - } //end user class ?> |