diff --git a/.gitignore b/.gitignore index da20911..ce6cc14 100644 --- a/.gitignore +++ b/.gitignore @@ -263,3 +263,4 @@ __pycache__/ # Custom project ignore Examples/ExampleNet47/App.config coverage.json +SpotifyWebApi/FodyWeavers.xsd diff --git a/SpotifyWebApi/FodyWeavers.xml b/SpotifyWebApi/FodyWeavers.xml index d75fc78..323841c 100644 --- a/SpotifyWebApi/FodyWeavers.xml +++ b/SpotifyWebApi/FodyWeavers.xml @@ -1,4 +1,7 @@  - - - \ No newline at end of file + + + diff --git a/SpotifyWebApi/Model/Auth/Token.cs b/SpotifyWebApi/Model/Auth/Token.cs index 10be295..fbcd3d0 100644 --- a/SpotifyWebApi/Model/Auth/Token.cs +++ b/SpotifyWebApi/Model/Auth/Token.cs @@ -53,13 +53,13 @@ public Token() /// Gets the token generated. /// [JsonProperty("token_generated")] - public DateTime TokenGenerated { get; private set; } + public DateTime TokenGenerated { get; set; } = DateTime.UtcNow; /// /// Gets a value indicating whether this instance is expired. /// [JsonIgnore] - public bool IsExpired => DateTime.Now > this.TokenGenerated.AddSeconds(this.ExpiresIn); + public bool IsExpired => DateTime.UtcNow > this.TokenGenerated.AddSeconds(this.ExpiresIn); /// /// Gets a value indicating wheter this token can be used to access personal data. @@ -101,7 +101,7 @@ public static Token Make( RefreshToken = refreshToken, Type = tokenType, ExpiresIn = expiresIn, - TokenGenerated = tokenGenerated ?? DateTime.Now, + TokenGenerated = tokenGenerated ?? DateTime.UtcNow, Scope = scope ?? string.Empty, CanAccessPersonalData = canAccessPersonalData, AuthenticationType = authenticationType diff --git a/SpotifyWebApi/Properties/AssemblyInfo.cs b/SpotifyWebApi/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..18b7fec --- /dev/null +++ b/SpotifyWebApi/Properties/AssemblyInfo.cs @@ -0,0 +1,7 @@ +// Internals only visible for testing purpose. + +using System.Runtime.CompilerServices; +using Fody; + +[assembly: InternalsVisibleTo("SpotifyWebApiTest")] +[assembly: ConfigureAwait(false)] diff --git a/SpotifyWebApi/SpotifyWebApi.cs b/SpotifyWebApi/SpotifyWebApi.cs index 76b3562..39dc502 100644 --- a/SpotifyWebApi/SpotifyWebApi.cs +++ b/SpotifyWebApi/SpotifyWebApi.cs @@ -1,7 +1,3 @@ -// Internals only visible for testing purpose. -using System.Runtime.CompilerServices; -[assembly:InternalsVisibleTo("SpotifyWebApiTest")] - namespace SpotifyWebApi { using System; diff --git a/SpotifyWebApi/SpotifyWebApi.csproj b/SpotifyWebApi/SpotifyWebApi.csproj index 19dc77b..b6eee94 100644 --- a/SpotifyWebApi/SpotifyWebApi.csproj +++ b/SpotifyWebApi/SpotifyWebApi.csproj @@ -11,7 +11,7 @@ Pim Merks Pim Merks SpotifyWebApi-Core - A Spotify Web API wrapper. + A Spotify Web API wrapper for C#. Pim Merks Github https://github.com/pimmerks/SpotifyWebApi @@ -23,13 +23,21 @@ - + - + + + + + + all + runtime; build; native; contentfiles; analyzers + + all @@ -43,13 +51,4 @@ true - - - - 0.0.0 - 0.0.0 - 0.0.0 - 0.0.0 - -