示例#1
0
 public ScrobblerService(ICredentialHelper credentialHelper)
 {
     _credentialHelper = credentialHelper;
     _auth = new LastAuth(ApiKeys.LastFmId, ApiKeys.LastFmSecret);
     _albumApi = new AlbumApi(_auth);
     _artistApi = new ArtistApi(_auth);
     _chartApi = new ChartApi(_auth);
     _trackApi = new TrackApi(_auth);
     _userApi = new UserApi(_auth);
     GetSessionTokenAsync();
 }
示例#2
0
 public async void ScrobbleTrack(string artist, string album, string track)
 {
     var trackApi = new TrackApi(_auth);
     var scrobble = new Scrobble(artist, album, track, DateTimeOffset.Now);
     IScrobbler _scrobbler;
     _scrobbler = new Scrobbler(_auth);
     var response = await _scrobbler.ScrobbleAsync(scrobble);
     if (response.Success)
     {
         Debug.WriteLine("Scrobble success!");
     }
     else
     {
         Debug.WriteLine("Scrobble failed!");
     }
 }