Added 3 compilebreakers on Todo Items

This commit is contained in:
Jimmy Appelt 2015-11-06 19:44:52 +01:00
parent d3b6913690
commit a913f1d459

View File

@ -638,6 +638,7 @@ namespace SpotifyAPI.Web
if (!UseAuth) if (!UseAuth)
throw new InvalidOperationException("Auth is required for IsFollowing"); throw new InvalidOperationException("Auth is required for IsFollowing");
JToken res = DownloadDataAsync<JToken>(_builder.IsFollowing(followType, ids)); JToken res = DownloadDataAsync<JToken>(_builder.IsFollowing(followType, ids));
# Compilebreaker
if (res is JArray) //todo expression is always false if (res is JArray) //todo expression is always false
return Task.FromResult(new ListResponse<Boolean> { List = res.ToObject<List<Boolean>>(), Error = null }); return Task.FromResult(new ListResponse<Boolean> { List = res.ToObject<List<Boolean>>(), Error = null });
return Task.FromResult(new ListResponse<Boolean> { List = null, Error = res["error"].ToObject<Error>() }); return Task.FromResult(new ListResponse<Boolean> { List = null, Error = res["error"].ToObject<Error>() });
@ -768,6 +769,7 @@ namespace SpotifyAPI.Web
if (!UseAuth) if (!UseAuth)
throw new InvalidOperationException("Auth is required for IsFollowingPlaylist"); throw new InvalidOperationException("Auth is required for IsFollowingPlaylist");
JToken res = DownloadDataAsync<JToken>(_builder.IsFollowingPlaylist(ownerId, playlistId, ids)); JToken res = DownloadDataAsync<JToken>(_builder.IsFollowingPlaylist(ownerId, playlistId, ids));
# Compilebreaker
if (res is JArray) //todo expression is always false if (res is JArray) //todo expression is always false
return Task.FromResult(new ListResponse<Boolean> { List = res.ToObject<List<Boolean>>(), Error = null }); return Task.FromResult(new ListResponse<Boolean> { List = res.ToObject<List<Boolean>>(), Error = null });
return Task.FromResult(new ListResponse<Boolean> { List = null, Error = res["error"].ToObject<Error>() }); return Task.FromResult(new ListResponse<Boolean> { List = null, Error = res["error"].ToObject<Error>() });
@ -930,6 +932,7 @@ namespace SpotifyAPI.Web
if (!UseAuth) if (!UseAuth)
throw new InvalidOperationException("Auth is required for CheckSavedTracks"); throw new InvalidOperationException("Auth is required for CheckSavedTracks");
JToken res = DownloadDataAsync<JToken>(_builder.CheckSavedTracks(ids)); JToken res = DownloadDataAsync<JToken>(_builder.CheckSavedTracks(ids));
# Compilebreaker
if (res is JArray) //todo expression is always false if (res is JArray) //todo expression is always false
return Task.FromResult(new ListResponse<Boolean> { List = res.ToObject<List<Boolean>>(), Error = null }); return Task.FromResult(new ListResponse<Boolean> { List = res.ToObject<List<Boolean>>(), Error = null });
return Task.FromResult(new ListResponse<Boolean> { List = null, Error = res["error"].ToObject<Error>() }); return Task.FromResult(new ListResponse<Boolean> { List = null, Error = res["error"].ToObject<Error>() });