diff options
Diffstat (limited to 'lib/class/user.class.php')
-rw-r--r-- | lib/class/user.class.php | 31 |
1 files changed, 4 insertions, 27 deletions
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 ?> |