Fixed warnings and polished publish script

This commit is contained in:
Jonas Dellinger 2020-06-04 20:56:47 +02:00
parent 14dd959354
commit fb5b81b747
4 changed files with 9 additions and 2 deletions

View File

@ -142,6 +142,7 @@ namespace SpotifyAPI.Web
/// <param name="mapper">A function which maps response objects to the next paging object</param> /// <param name="mapper">A function which maps response objects to the next paging object</param>
/// <param name="paginator">Optional. If not supplied, DefaultPaginator will be used</param> /// <param name="paginator">Optional. If not supplied, DefaultPaginator will be used</param>
/// <typeparam name="T">The Paging-Type</typeparam> /// <typeparam name="T">The Paging-Type</typeparam>
/// <typeparam name="TNext">The Response-Type</typeparam>
/// <returns>A list containing all fetched pages</returns> /// <returns>A list containing all fetched pages</returns>
Task<IList<T>> PaginateAll<T, TNext>( Task<IList<T>> PaginateAll<T, TNext>(
Paging<T, TNext> firstPage, Paging<T, TNext> firstPage,

View File

@ -92,10 +92,11 @@ namespace SpotifyAPI.Web
{ {
new KeyValuePair<string, string>("refresh_token", request.RefreshToken) new KeyValuePair<string, string>("refresh_token", request.RefreshToken)
}; };
#pragma warning disable CA2000
return apiConnector.Post<AuthorizationCodeRefreshResponse>( return apiConnector.Post<AuthorizationCodeRefreshResponse>(
request.RefreshUri, null, new FormUrlEncodedContent(form) request.RefreshUri, null, new FormUrlEncodedContent(form)
); );
#pragma warning restore CA2000
} }
public static Task<AuthorizationCodeTokenResponse> RequestToken( public static Task<AuthorizationCodeTokenResponse> RequestToken(
@ -110,9 +111,11 @@ namespace SpotifyAPI.Web
new KeyValuePair<string, string>("code", request.Code) new KeyValuePair<string, string>("code", request.Code)
}; };
#pragma warning disable CA2000
return apiConnector.Post<AuthorizationCodeTokenResponse>( return apiConnector.Post<AuthorizationCodeTokenResponse>(
request.TokenUri, null, new FormUrlEncodedContent(form) request.TokenUri, null, new FormUrlEncodedContent(form)
); );
#pragma warning restore CA2000
} }
public static Task<CredentialsTokenResponse> RequestToken( public static Task<CredentialsTokenResponse> RequestToken(
@ -170,7 +173,9 @@ namespace SpotifyAPI.Web
string clientSecret) string clientSecret)
{ {
var headers = BuildAuthHeader(clientId, clientSecret); var headers = BuildAuthHeader(clientId, clientSecret);
#pragma warning disable CA2000
return apiConnector.Post<T>(SpotifyUrls.OAuthToken, null, new FormUrlEncodedContent(form), headers); return apiConnector.Post<T>(SpotifyUrls.OAuthToken, null, new FormUrlEncodedContent(form), headers);
#pragma warning restore CA2000
} }
private static Dictionary<string, string> BuildAuthHeader(string clientId, string clientSecret) private static Dictionary<string, string> BuildAuthHeader(string clientId, string clientSecret)

View File

@ -142,6 +142,7 @@ namespace SpotifyAPI.Web
/// <param name="mapper">A function which maps response objects to the next paging object</param> /// <param name="mapper">A function which maps response objects to the next paging object</param>
/// <param name="paginator">Optional. If not supplied, DefaultPaginator will be used</param> /// <param name="paginator">Optional. If not supplied, DefaultPaginator will be used</param>
/// <typeparam name="T">The Paging-Type</typeparam> /// <typeparam name="T">The Paging-Type</typeparam>
/// <typeparam name="TNext">The Response-Type</typeparam>
/// <returns>A list containing all fetched pages</returns> /// <returns>A list containing all fetched pages</returns>
public Task<IList<T>> PaginateAll<T, TNext>( public Task<IList<T>> PaginateAll<T, TNext>(
Paging<T, TNext> firstPage, Paging<T, TNext> firstPage,

View File

@ -2,7 +2,7 @@
set -e set -e
if [ -n "$APPVEYOR_REPO_TAG" ]; then if [ "$APPVEYOR_REPO_TAG" = "true" ]; then
echo "Publishing..." echo "Publishing..."
sudo curl -o /usr/local/bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe sudo curl -o /usr/local/bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe