예제 #1
0
 /**
  * set_flag
  * This takes care of spreading your love on Last.fm
  */
 public function set_flag($song, $flagged)
 {
     // Make sure there's actually a session before we keep going
     if (!$this->challenge) {
         debug_event($this->name, 'Session key missing', '5');
         return false;
     }
     // Create our scrobbler and then queue it
     $scrobbler = new scrobbler($this->api_key, $this->scheme, $this->api_host, $this->challenge, $this->secret);
     if (!$scrobbler->love($flagged, 'song', $song->f_artist_full, $song->title, $song->f_album_full)) {
         debug_event($this->name, 'Error Love Failed: ' . $scrobbler->error_msg, '3');
         return false;
     }
     debug_event($this->name, 'Sent Love Successfully', '5');
     return true;
 }