mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2024-12-23 22:56:25 +00:00
VSCode Formatter - Also bumped tests to net core 3.1
This commit is contained in:
parent
307d69945e
commit
466e61523d
@ -1,4 +1,4 @@
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SpotifyAPI.Web.Auth
|
||||
|
@ -18,13 +18,10 @@ namespace SpotifyAPI.Web.Auth
|
||||
|
||||
public ProxyConfig ProxyConfig { get; set; }
|
||||
|
||||
public AuthorizationCodeAuth(string redirectUri, string serverUri, Scope scope = Scope.None, string state = "")
|
||||
: base("code", "AuthorizationCodeAuth", redirectUri, serverUri, scope, state)
|
||||
{
|
||||
}
|
||||
public AuthorizationCodeAuth(string redirectUri, string serverUri, Scope scope = Scope.None, string state = "") : base("code", "AuthorizationCodeAuth", redirectUri, serverUri, scope, state)
|
||||
{ }
|
||||
|
||||
public AuthorizationCodeAuth(string clientId, string secretId, string redirectUri, string serverUri, Scope scope = Scope.None, string state = "")
|
||||
: this(redirectUri, serverUri, scope, state)
|
||||
public AuthorizationCodeAuth(string clientId, string secretId, string redirectUri, string serverUri, Scope scope = Scope.None, string state = "") : this(redirectUri, serverUri, scope, state)
|
||||
{
|
||||
ClientId = clientId;
|
||||
SecretId = secretId;
|
||||
@ -130,7 +127,6 @@ namespace SpotifyAPI.Web.Auth
|
||||
}
|
||||
|
||||
public AuthorizationCodeAuthController(IHttpContext context) : base(context)
|
||||
{
|
||||
}
|
||||
{ }
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
@ -27,8 +27,7 @@ namespace SpotifyAPI.Web.Auth
|
||||
string auth = Convert.ToBase64String(Encoding.UTF8.GetBytes(ClientId + ":" + ClientSecret));
|
||||
|
||||
List<KeyValuePair<string, string>> args = new List<KeyValuePair<string, string>>
|
||||
{
|
||||
new KeyValuePair<string, string>("grant_type", "client_credentials")
|
||||
{new KeyValuePair<string, string>("grant_type", "client_credentials")
|
||||
};
|
||||
|
||||
HttpClientHandler handler = ProxyConfig.CreateClientHandler(ProxyConfig);
|
||||
|
@ -9,8 +9,7 @@ namespace SpotifyAPI.Web.Auth
|
||||
{
|
||||
public class ImplicitGrantAuth : SpotifyAuthServer<Token>
|
||||
{
|
||||
public ImplicitGrantAuth(string clientId, string redirectUri, string serverUri, Scope scope = Scope.None, string state = "") :
|
||||
base("token", "ImplicitGrantAuth", redirectUri, serverUri, scope, state)
|
||||
public ImplicitGrantAuth(string clientId, string redirectUri, string serverUri, Scope scope = Scope.None, string state = "") : base("token", "ImplicitGrantAuth", redirectUri, serverUri, scope, state)
|
||||
{
|
||||
ClientId = clientId;
|
||||
}
|
||||
@ -59,7 +58,6 @@ namespace SpotifyAPI.Web.Auth
|
||||
}
|
||||
|
||||
public ImplicitGrantAuthController(IHttpContext context) : base(context)
|
||||
{
|
||||
}
|
||||
{ }
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
@ -1,14 +1,14 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
using SpotifyAPI.Web.Enums;
|
||||
using SpotifyAPI.Web.Models;
|
||||
using Unosquare.Labs.EmbedIO;
|
||||
using Unosquare.Labs.EmbedIO.Constants;
|
||||
using Unosquare.Labs.EmbedIO.Modules;
|
||||
using SpotifyAPI.Web.Models;
|
||||
using Newtonsoft.Json;
|
||||
using System.Net.Http;
|
||||
|
||||
namespace SpotifyAPI.Web.Auth
|
||||
{
|
||||
@ -91,8 +91,7 @@ namespace SpotifyAPI.Web.Auth
|
||||
int currentRetries = 0)
|
||||
{
|
||||
FormUrlEncodedContent content = new FormUrlEncodedContent(new Dictionary<string, string>
|
||||
{
|
||||
{"grant_type", grantType},
|
||||
{ { "grant_type", grantType },
|
||||
{ "code", authorizationCode },
|
||||
{ "refresh_token", refreshToken }
|
||||
});
|
||||
@ -111,8 +110,7 @@ namespace SpotifyAPI.Web.Auth
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
if (currentRetries >= MaxGetTokenRetries)
|
||||
{
|
||||
@ -194,8 +192,7 @@ namespace SpotifyAPI.Web.Auth
|
||||
internal class TokenSwapAuthController : WebApiController
|
||||
{
|
||||
public TokenSwapAuthController(IHttpContext context) : base(context)
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
[WebApiHandler(HttpVerbs.Get, "/auth")]
|
||||
public Task<bool> GetAuth()
|
||||
|
@ -1,9 +1,9 @@
|
||||
using SpotifyAPI.Web.Enums;
|
||||
using SpotifyAPI.Web.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using SpotifyAPI.Web.Enums;
|
||||
using SpotifyAPI.Web.Models;
|
||||
|
||||
namespace SpotifyAPI.Web.Auth
|
||||
{
|
||||
@ -127,8 +127,7 @@ namespace SpotifyAPI.Web.Auth
|
||||
public static new AccessTokenExpiredEventArgs Empty { get; } = new AccessTokenExpiredEventArgs();
|
||||
|
||||
public AccessTokenExpiredEventArgs()
|
||||
{
|
||||
}
|
||||
{ }
|
||||
}
|
||||
/// <summary>
|
||||
/// When the authorization from Spotify expires. This will only occur if <see cref="AutoRefresh"/> is true.
|
||||
@ -140,8 +139,7 @@ namespace SpotifyAPI.Web.Auth
|
||||
public static new AuthSuccessEventArgs Empty { get; } = new AuthSuccessEventArgs();
|
||||
|
||||
public AuthSuccessEventArgs()
|
||||
{
|
||||
}
|
||||
{ }
|
||||
}
|
||||
/// <summary>
|
||||
/// When an authorization attempt succeeds and gains authorization.
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
|
@ -26,7 +26,7 @@ namespace SpotifyAPI.Web.Examples.ASP
|
||||
.AddCookie()
|
||||
.AddSpotify(options =>
|
||||
{
|
||||
var scopes = Scope.UserLibraryRead;
|
||||
var scopes = Scope.UserLibraryRead | Scope.UserModifyPlaybackState;
|
||||
options.Scope.Add(scopes.GetStringAttribute(","));
|
||||
|
||||
options.SaveTokens = true;
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using SpotifyAPI.Web.Auth;
|
||||
using SpotifyAPI.Web.Enums;
|
||||
@ -14,13 +14,13 @@ namespace SpotifyAPI.Web.Examples.CLI
|
||||
// ReSharper disable once UnusedParameter.Local
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
_clientId = string.IsNullOrEmpty(_clientId)
|
||||
? Environment.GetEnvironmentVariable("SPOTIFY_CLIENT_ID")
|
||||
: _clientId;
|
||||
_clientId = string.IsNullOrEmpty(_clientId) ?
|
||||
Environment.GetEnvironmentVariable("SPOTIFY_CLIENT_ID") :
|
||||
_clientId;
|
||||
|
||||
_secretId = string.IsNullOrEmpty(_secretId)
|
||||
? Environment.GetEnvironmentVariable("SPOTIFY_SECRET_ID")
|
||||
: _secretId;
|
||||
_secretId = string.IsNullOrEmpty(_secretId) ?
|
||||
Environment.GetEnvironmentVariable("SPOTIFY_SECRET_ID") :
|
||||
_secretId;
|
||||
|
||||
Console.WriteLine("####### Spotify API Example #######");
|
||||
Console.WriteLine("This example uses AuthorizationCodeAuth.");
|
||||
@ -37,8 +37,6 @@ namespace SpotifyAPI.Web.Examples.CLI
|
||||
Console.ReadLine();
|
||||
auth.Stop(0);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private static async void AuthOnAuthReceived(object sender, AuthorizationCode payload)
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace SpotifyAPI.Web.Tests
|
||||
|
@ -1,8 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@ -67,7 +67,6 @@ namespace SpotifyAPI.Web.Tests
|
||||
_mock.Setup(client => client.DownloadJson<PublicProfile>(It.IsAny<string>(), It.IsAny<Dictionary<string, string>>()))
|
||||
.Returns(new Tuple<ResponseInfo, PublicProfile>(ResponseInfo.Empty, profile));
|
||||
|
||||
|
||||
_spotify.UseAuth = false;
|
||||
Assert.AreEqual(profile, _spotify.GetPublicProfile("wizzler"));
|
||||
_mock.Verify(client => client.DownloadJson<PublicProfile>(
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace SpotifyAPI.Web.Tests
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
|
||||
namespace SpotifyAPI.Web.Enums
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
|
||||
namespace SpotifyAPI.Web.Enums
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
|
||||
namespace SpotifyAPI.Web.Enums
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
|
||||
namespace SpotifyAPI.Web.Enums
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
|
||||
namespace SpotifyAPI.Web.Enums
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
|
||||
namespace SpotifyAPI.Web.Enums
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
|
||||
namespace SpotifyAPI.Web.Enums
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
using SpotifyAPI.Web.Models;
|
||||
|
||||
namespace SpotifyAPI.Web
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
|
@ -1,5 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Net;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
@ -18,8 +18,7 @@ namespace SpotifyAPI.Web.Models
|
||||
}
|
||||
|
||||
public class ErrorResponse : BasicModel
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
public class Error
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using SpotifyAPI.Web.Enums;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System.Net;
|
||||
using System.Net;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
|
@ -1,5 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SpotifyAPI.Web.Models
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Reflection;
|
||||
|
||||
@ -57,9 +57,9 @@ namespace SpotifyAPI.Web.Models
|
||||
string name = info.GetCustomAttribute<StringAttribute>()?.Text;
|
||||
if (name == null || value == null)
|
||||
continue;
|
||||
urlParams.Add(value is float valueAsFloat
|
||||
? $"{prefix}_{name}={valueAsFloat.ToString(CultureInfo.InvariantCulture)}"
|
||||
: $"{prefix}_{name}={value}");
|
||||
urlParams.Add(value is float valueAsFloat ?
|
||||
$"{prefix}_{name}={valueAsFloat.ToString(CultureInfo.InvariantCulture)}" :
|
||||
$"{prefix}_{name}={value}");
|
||||
}
|
||||
if (urlParams.Count > 0)
|
||||
return "&" + string.Join("&", urlParams);
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
@ -1,4 +1,3 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
@ -6,6 +5,7 @@ using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
using SpotifyAPI.Web.Models;
|
||||
|
||||
namespace SpotifyAPI.Web
|
||||
@ -83,7 +83,8 @@ namespace SpotifyAPI.Web
|
||||
|
||||
public async Task<Tuple<ResponseInfo, T>> DownloadJsonAsync<T>(string url, Dictionary<string, string> headers = null)
|
||||
{
|
||||
Tuple<ResponseInfo, string> response = await DownloadAsync(url, headers).ConfigureAwait(false);try
|
||||
Tuple<ResponseInfo, string> response = await DownloadAsync(url, headers).ConfigureAwait(false);
|
||||
try
|
||||
{
|
||||
return new Tuple<ResponseInfo, T>(response.Item1, JsonConvert.DeserializeObject<T>(response.Item2, JsonSettings));
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
|
Loading…
Reference in New Issue
Block a user