mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2024-12-23 14:46:26 +00:00
fix null checks and duplicate EOL
This commit is contained in:
parent
d5059820b6
commit
dcec5467a8
@ -19,6 +19,7 @@ namespace SpotifyAPI.Web
|
|||||||
public Task<FullArtist> Get(string artistId, ArtistRequest request, CancellationToken cancel = default)
|
public Task<FullArtist> Get(string artistId, ArtistRequest request, CancellationToken cancel = default)
|
||||||
{
|
{
|
||||||
Ensure.ArgumentNotNullOrEmptyString(artistId, nameof(artistId));
|
Ensure.ArgumentNotNullOrEmptyString(artistId, nameof(artistId));
|
||||||
|
Ensure.ArgumentNotNull(request, nameof(request));
|
||||||
|
|
||||||
return API.Get<FullArtist>(URLs.Artist(artistId), request.BuildQueryParams(), cancel);
|
return API.Get<FullArtist>(URLs.Artist(artistId), request.BuildQueryParams(), cancel);
|
||||||
}
|
}
|
||||||
@ -48,6 +49,7 @@ namespace SpotifyAPI.Web
|
|||||||
public Task<ArtistsRelatedArtistsResponse> GetRelatedArtists(string artistId, ArtistsRelatedArtistsRequest request, CancellationToken cancel = default)
|
public Task<ArtistsRelatedArtistsResponse> GetRelatedArtists(string artistId, ArtistsRelatedArtistsRequest request, CancellationToken cancel = default)
|
||||||
{
|
{
|
||||||
Ensure.ArgumentNotNullOrEmptyString(artistId, nameof(artistId));
|
Ensure.ArgumentNotNullOrEmptyString(artistId, nameof(artistId));
|
||||||
|
Ensure.ArgumentNotNull(request, nameof(request));
|
||||||
|
|
||||||
return API.Get<ArtistsRelatedArtistsResponse>(URLs.ArtistRelatedArtists(artistId), request.BuildQueryParams(), cancel);
|
return API.Get<ArtistsRelatedArtistsResponse>(URLs.ArtistRelatedArtists(artistId), request.BuildQueryParams(), cancel);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace SpotifyAPI.Web
|
namespace SpotifyAPI.Web
|
||||||
{
|
{
|
||||||
public class ArtistRequest : RequestParams
|
public class ArtistRequest : RequestParams
|
||||||
|
@ -15,8 +15,8 @@ namespace SpotifyAPI.Web
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value></value>
|
/// <value></value>
|
||||||
[QueryParam("offset")]
|
[QueryParam("offset")]
|
||||||
public int? Offset { get; set; }
|
public int? Offset { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The desired language, consisting of an ISO 639-1 language code and an ISO 3166-1 alpha-2 country code,
|
/// The desired language, consisting of an ISO 639-1 language code and an ISO 3166-1 alpha-2 country code,
|
||||||
/// joined by an underscore. For example: es_MX, meaning "Spanish (Mexico)".
|
/// joined by an underscore. For example: es_MX, meaning "Spanish (Mexico)".
|
||||||
@ -25,8 +25,7 @@ namespace SpotifyAPI.Web
|
|||||||
/// the category strings returned will be in the Spotify default language (American English).
|
/// the category strings returned will be in the Spotify default language (American English).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value></value>
|
/// <value></value>
|
||||||
[QueryParam("locale")]
|
[QueryParam("locale")]
|
||||||
public string? Locale { get; set; }
|
public string? Locale { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user