예제 #1
0
        public async Task <UserApiClient> GetAuthorizedApiClientAsync(string apiKey, string secret, string username, string sessionKey)
        {
            var client = new UserApiClient(apiKey, secret, username, sessionKey);

            if (!client.Authorized)
            {
                await client.GetToken();
            }

            return(client);
        }
예제 #2
0
        public async Task <bool> IsLovedAsync(UserApiClient client, Track track)
        {
            var isLovedMethod = new IsLovedMethod(client, track, client.Username);

            return(await isLovedMethod.GetResultAsync());
        }
예제 #3
0
 public async Task UnloveTrackAsync(UserApiClient client, Track track)
 {
     var unloveTrackMethod = new UnloveTrackMethod(client, track);
     await unloveTrackMethod.PostAsync();
 }
예제 #4
0
 public async Task UpdateNowPlayingAsync(UserApiClient client, Track track, int duration)
 {
     var updateNowPlayingMethod = new UpdateNowPlayingMethod(client, track, duration);
     await updateNowPlayingMethod.PostAsync();
 }
예제 #5
0
 public async Task ScrobbleAsync(UserApiClient client, Track track, DateTime timePlayed)
 {
     var scrobbleMethod = new ScrobbleMethod(client, track, timePlayed);
     await scrobbleMethod.PostAsync();
 }
예제 #6
0
 public async Task Authorize(UserApiClient client, int maxAttempts)
 {
     await client.Authorize(maxAttempts);
 }