Async methods return Tasks instead of void.

This commit is contained in:
Petr Houška 2016-09-08 12:38:37 +02:00
parent dd2b39292a
commit 3e7265a657

View File

@ -22,23 +22,23 @@ namespace SpotifyAPI.Local
return !string.IsNullOrEmpty(CfidKey);
}
internal async void SendPauseRequest()
internal async Task SendPauseRequest()
{
await QueryAsync("remote/pause.json?pause=true", true, true, -1);
}
internal async void SendPlayRequest()
internal async Task SendPlayRequest()
{
await QueryAsync("remote/pause.json?pause=false", true, true, -1);
}
internal async void SendPlayRequest(string url, string context = "")
internal async Task SendPlayRequest(string url, string context = "")
{
// TODO: instead of having an empty context, one way to fix the bug with the playback time beyond the length of a song would be to provide a 1-song context, and it would be fixed.
await QueryAsync($"remote/play.json?uri={url}&context={context}", true, true, -1);
}
internal async void SendQueueRequest(string url)
internal async Task SendQueueRequest(string url)
{
await QueryAsync("remote/play.json?uri=" + url + "?action=queue", true, true, -1);
}