Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public async Task <bool> IsLovedAsync(UserApiClient client, Track track)
        {
            var isLovedMethod = new IsLovedMethod(client, track, client.Username);

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