mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2024-12-24 23:16:28 +00:00
Added RecommendationGenres and NewReleases
This commit is contained in:
parent
9f6729ad60
commit
8074ff6331
@ -58,5 +58,22 @@ namespace SpotifyAPI.Web
|
|||||||
|
|
||||||
return API.Get<RecommendationsResponse>(URLs.Recommendations(), request.BuildQueryParams());
|
return API.Get<RecommendationsResponse>(URLs.Recommendations(), request.BuildQueryParams());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Task<RecommendationGenresResponse> GetRecommendationGenres()
|
||||||
|
{
|
||||||
|
return API.Get<RecommendationGenresResponse>(URLs.Recommendations());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task<NewReleasesResponse> GetNewReleases()
|
||||||
|
{
|
||||||
|
return API.Get<NewReleasesResponse>(URLs.NewReleases());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task<NewReleasesResponse> GetNewReleases(NewReleasesRequest request)
|
||||||
|
{
|
||||||
|
Ensure.ArgumentNotNull(request, nameof(request));
|
||||||
|
|
||||||
|
return API.Get<NewReleasesResponse>(URLs.NewReleases(), request.BuildQueryParams());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,5 +14,9 @@ namespace SpotifyAPI.Web
|
|||||||
Task<CategoryPlaylistsResponse> GetCategoryPlaylists(string categoryId, CategoriesPlaylistsRequest request);
|
Task<CategoryPlaylistsResponse> GetCategoryPlaylists(string categoryId, CategoriesPlaylistsRequest request);
|
||||||
|
|
||||||
Task<RecommendationsResponse> GetRecommendations(RecommendationsRequest request);
|
Task<RecommendationsResponse> GetRecommendations(RecommendationsRequest request);
|
||||||
|
Task<RecommendationGenresResponse> GetRecommendationGenres();
|
||||||
|
|
||||||
|
Task<NewReleasesResponse> GetNewReleases();
|
||||||
|
Task<NewReleasesResponse> GetNewReleases(NewReleasesRequest request);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
14
SpotifyAPI.Web/Models/Request/NewReleasesRequest.cs
Normal file
14
SpotifyAPI.Web/Models/Request/NewReleasesRequest.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
namespace SpotifyAPI.Web
|
||||||
|
{
|
||||||
|
public class NewReleasesRequest : RequestParams
|
||||||
|
{
|
||||||
|
[QueryParam("country")]
|
||||||
|
public string Country { get; set; }
|
||||||
|
|
||||||
|
[QueryParam("limit")]
|
||||||
|
public int? Limit { get; set; }
|
||||||
|
|
||||||
|
[QueryParam("offset")]
|
||||||
|
public int? Offset { get; set; }
|
||||||
|
}
|
||||||
|
}
|
8
SpotifyAPI.Web/Models/Response/NewReleasesResponse.cs
Normal file
8
SpotifyAPI.Web/Models/Response/NewReleasesResponse.cs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
namespace SpotifyAPI.Web
|
||||||
|
{
|
||||||
|
public class NewReleasesResponse
|
||||||
|
{
|
||||||
|
public string Message { get; set; }
|
||||||
|
public Paging<SimpleAlbum> Albums { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace SpotifyAPI.Web
|
||||||
|
{
|
||||||
|
public class RecommendationGenresResponse
|
||||||
|
{
|
||||||
|
public List<string> Genres { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -19,6 +19,10 @@ namespace SpotifyAPI.Web
|
|||||||
|
|
||||||
public static Uri Recommendations() => EUri($"recommendations");
|
public static Uri Recommendations() => EUri($"recommendations");
|
||||||
|
|
||||||
|
public static Uri RecommendationGenres() => EUri($"recommendations/available-genre-seeds");
|
||||||
|
|
||||||
|
public static Uri NewReleases() => EUri($"browse/new-releases");
|
||||||
|
|
||||||
private static Uri EUri(FormattableString path) => new Uri(path.ToString(_provider), UriKind.Relative);
|
private static Uri EUri(FormattableString path) => new Uri(path.ToString(_provider), UriKind.Relative);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user