remove SimplePlaylist

This commit is contained in:
Jonas Dellinger 2023-05-27 22:20:33 +02:00
parent 842217e24b
commit 4d577bccf0
8 changed files with 19 additions and 48 deletions

View File

@ -10,7 +10,7 @@ namespace Example.ASP.Pages
private const int LIMIT = 10;
private readonly SpotifyClientBuilder _spotifyClientBuilder;
public Paging<SimplePlaylist> Playlists { get; set; }
public Paging<FullPlaylist> Playlists { get; set; }
public string Next { get; set; }
public string Previous { get; set; }

View File

@ -15,10 +15,10 @@ namespace Example.UWP.ViewModels
{
private SpotifyClient _spotify;
private IList<SimplePlaylist> _playlists;
public IList<SimplePlaylist> Playlists
private IList<FullPlaylist> _playlists;
public IList<FullPlaylist> Playlists
{
get => _playlists ?? (_playlists = new List<SimplePlaylist>());
get => _playlists ?? (_playlists = new List<FullPlaylist>());
set => SetProperty(ref _playlists, value);
}

View File

@ -100,7 +100,7 @@ namespace SpotifyAPI.Web
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-get-list-users-playlists
/// </remarks>
/// <returns></returns>
Task<Paging<SimplePlaylist>> GetUsers(string userId, CancellationToken cancel = default);
Task<Paging<FullPlaylist>> GetUsers(string userId, CancellationToken cancel = default);
/// <summary>
/// Get a list of the playlists owned or followed by a Spotify user.
@ -112,7 +112,7 @@ namespace SpotifyAPI.Web
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-get-list-users-playlists
/// </remarks>
/// <returns></returns>
Task<Paging<SimplePlaylist>> GetUsers(string userId, PlaylistGetUsersRequest request, CancellationToken cancel = default);
Task<Paging<FullPlaylist>> GetUsers(string userId, PlaylistGetUsersRequest request, CancellationToken cancel = default);
/// <summary>
/// Get a playlist owned by a Spotify user.
@ -160,7 +160,7 @@ namespace SpotifyAPI.Web
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-get-a-list-of-current-users-playlists
/// </remarks>
/// <returns></returns>
Task<Paging<SimplePlaylist>> CurrentUsers(CancellationToken cancel = default);
Task<Paging<FullPlaylist>> CurrentUsers(CancellationToken cancel = default);
/// <summary>
/// Get a list of the playlists owned or followed by the current Spotify user.
@ -171,7 +171,7 @@ namespace SpotifyAPI.Web
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-get-a-list-of-current-users-playlists
/// </remarks>
/// <returns></returns>
Task<Paging<SimplePlaylist>> CurrentUsers(PlaylistCurrentUsersRequest request, CancellationToken cancel = default);
Task<Paging<FullPlaylist>> CurrentUsers(PlaylistCurrentUsersRequest request, CancellationToken cancel = default);
/// <summary>
/// Change a playlists name and public/private state. (The user must, of course, own the playlist.)

View File

@ -66,19 +66,19 @@ namespace SpotifyAPI.Web
return API.Get<List<Image>>(URLs.PlaylistImages(playlistId), cancel);
}
public Task<Paging<SimplePlaylist>> GetUsers(string userId, CancellationToken cancel = default)
public Task<Paging<FullPlaylist>> GetUsers(string userId, CancellationToken cancel = default)
{
Ensure.ArgumentNotNullOrEmptyString(userId, nameof(userId));
return API.Get<Paging<SimplePlaylist>>(URLs.UserPlaylists(userId), cancel);
return API.Get<Paging<FullPlaylist>>(URLs.UserPlaylists(userId), cancel);
}
public Task<Paging<SimplePlaylist>> GetUsers(string userId, PlaylistGetUsersRequest request, CancellationToken cancel = default)
public Task<Paging<FullPlaylist>> GetUsers(string userId, PlaylistGetUsersRequest request, CancellationToken cancel = default)
{
Ensure.ArgumentNotNullOrEmptyString(userId, nameof(userId));
Ensure.ArgumentNotNull(request, nameof(request));
return API.Get<Paging<SimplePlaylist>>(URLs.UserPlaylists(userId), request.BuildQueryParams(), cancel);
return API.Get<Paging<FullPlaylist>>(URLs.UserPlaylists(userId), request.BuildQueryParams(), cancel);
}
public Task<FullPlaylist> Get(string playlistId, CancellationToken cancel = default)
@ -105,16 +105,16 @@ namespace SpotifyAPI.Web
return statusCode == HttpStatusCode.Created;
}
public Task<Paging<SimplePlaylist>> CurrentUsers(CancellationToken cancel = default)
public Task<Paging<FullPlaylist>> CurrentUsers(CancellationToken cancel = default)
{
return API.Get<Paging<SimplePlaylist>>(URLs.CurrentUserPlaylists(), cancel);
return API.Get<Paging<FullPlaylist>>(URLs.CurrentUserPlaylists(), cancel);
}
public Task<Paging<SimplePlaylist>> CurrentUsers(PlaylistCurrentUsersRequest request, CancellationToken cancel = default)
public Task<Paging<FullPlaylist>> CurrentUsers(PlaylistCurrentUsersRequest request, CancellationToken cancel = default)
{
Ensure.ArgumentNotNull(request, nameof(request));
return API.Get<Paging<SimplePlaylist>>(URLs.CurrentUserPlaylists(), request.BuildQueryParams(), cancel);
return API.Get<Paging<FullPlaylist>>(URLs.CurrentUserPlaylists(), request.BuildQueryParams(), cancel);
}
public async Task<bool> ChangeDetails(string playlistId, PlaylistChangeDetailsRequest request, CancellationToken cancel = default)

View File

@ -2,7 +2,7 @@ namespace SpotifyAPI.Web
{
public class CategoryPlaylistsResponse
{
public Paging<SimplePlaylist, CategoryPlaylistsResponse> Playlists { get; set; } = default!;
public Paging<FullPlaylist, CategoryPlaylistsResponse> Playlists { get; set; } = default!;
}
}

View File

@ -3,7 +3,7 @@ namespace SpotifyAPI.Web
public class FeaturedPlaylistsResponse
{
public string Message { get; set; } = default!;
public Paging<SimplePlaylist, FeaturedPlaylistsResponse> Playlists { get; set; } = default!;
public Paging<FullPlaylist, FeaturedPlaylistsResponse> Playlists { get; set; } = default!;
}
}

View File

@ -7,7 +7,7 @@ namespace SpotifyAPI.Web
public Paging<FullTrack, SearchResponse> Tracks { get; set; } = default!;
public Paging<SimpleShow, SearchResponse> Shows { get; set; } = default!;
public Paging<SimpleEpisode, SearchResponse> Episodes { get; set; } = default!;
public Paging<SimplePlaylist, SearchResponse> Playlists { get; set; } = default!;
public Paging<FullPlaylist, SearchResponse> Playlists { get; set; } = default!;
}
}

View File

@ -1,29 +0,0 @@
using System.Collections.Generic;
namespace SpotifyAPI.Web
{
/// <summary>
/// <a href="https://developer.spotify.com/documentation/web-api/reference/object-model/#playlist-object-simplified">Docs</a>
/// </summary>
public class SimplePlaylist
{
public bool Collaborative { get; set; }
public string Description { get; set; } = default!;
public Dictionary<string, string> ExternalUrls { get; set; } = default!;
public string Href { get; set; } = default!;
public string Id { get; set; } = default!;
public List<Image> Images { get; set; } = default!;
public string Name { get; set; } = default!;
public PublicUser Owner { get; set; } = default!;
public bool? Public { get; set; }
public string SnapshotId { get; set; } = default!;
/// <summary>
/// A list of PlaylistTracks, which items can be a FullTrack or FullEpisode
/// </summary>
/// <value></value>
public Paging<PlaylistTrack<IPlayableItem>> Tracks { get; set; } = default!;
public string Type { get; set; } = default!;
public string Uri { get; set; } = default!;
}
}