示例#1
0
 public UnloveTrackMethod(UserApiClient client, LastFmApi.Track track)
     : base(client, "track.unlove")
 {
     SetParameters(new Dictionary <ParameterKey, string>
     {
         { ParameterKey.Track, track.Title },
         { ParameterKey.Artist, track.Artist }
     });
 }
示例#2
0
 public IsLovedMethod(ApiClient client, LastFmApi.Track track, string username)
     : base(client, "track.getInfo")
 {
     SetParameters(new Dictionary <ParameterKey, string>
     {
         { ParameterKey.Track, track.Title },
         { ParameterKey.Artist, track.Artist },
         { ParameterKey.Album, track.Album },
         { ParameterKey.AlbumArtist, track.AlbumArtist },
         { ParameterKey.Username, username }
     });
 }
 public UpdateNowPlayingMethod(UserApiClient client, LastFmApi.Track track, int duration)
     : base(client, "track.updateNowPlaying")
 {
     SetParameters(new Dictionary <ParameterKey, string>
     {
         { ParameterKey.Track, track.Title },
         { ParameterKey.Artist, track.Artist },
         { ParameterKey.Album, track.Album },
         { ParameterKey.AlbumArtist, track.AlbumArtist },
         { ParameterKey.Duration, duration.ToString() }
     });
 }
示例#4
0
        public ScrobbleMethod(UserApiClient client, LastFmApi.Track track, DateTime timePlayed)
            : base(client, "track.scrobble")
        {
            var scrobbleTime  = timePlayed.ToUniversalTime();
            var unixTimeStamp = (scrobbleTime.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;

            SetParameters(new Dictionary <ParameterKey, string>
            {
                { ParameterKey.Track, track.Title },
                { ParameterKey.Artist, track.Artist },
                { ParameterKey.Album, track.Album },
                { ParameterKey.AlbumArtist, track.AlbumArtist },
                { ParameterKey.Timestamp, unixTimeStamp.ToString() }
            });
        }