fix null checks and duplicate EOL

This commit is contained in:
Jonas Dellinger 2024-02-10 13:52:30 +01:00
parent d5059820b6
commit dcec5467a8
3 changed files with 6 additions and 7 deletions

View File

@ -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);
} }

View File

@ -1,5 +1,3 @@
using System.Collections.Generic;
namespace SpotifyAPI.Web namespace SpotifyAPI.Web
{ {
public class ArtistRequest : RequestParams public class ArtistRequest : RequestParams

View File

@ -29,4 +29,3 @@ namespace SpotifyAPI.Web
public string? Locale { get; set; } public string? Locale { get; set; }
} }
} }