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); }
public async Task <bool> IsLovedAsync(UserApiClient client, Track track) { var isLovedMethod = new IsLovedMethod(client, track, client.Username); return(await isLovedMethod.GetResultAsync()); }
public async Task UnloveTrackAsync(UserApiClient client, Track track) { var unloveTrackMethod = new UnloveTrackMethod(client, track); await unloveTrackMethod.PostAsync(); }
public async Task UpdateNowPlayingAsync(UserApiClient client, Track track, int duration) { var updateNowPlayingMethod = new UpdateNowPlayingMethod(client, track, duration); await updateNowPlayingMethod.PostAsync(); }
public async Task ScrobbleAsync(UserApiClient client, Track track, DateTime timePlayed) { var scrobbleMethod = new ScrobbleMethod(client, track, timePlayed); await scrobbleMethod.PostAsync(); }
public async Task Authorize(UserApiClient client, int maxAttempts) { await client.Authorize(maxAttempts); }