public async Task <bool> SaveAlbums(LibrarySaveAlbumsRequest request)
        {
            Ensure.ArgumentNotNull(request, nameof(request));

            var statusCode = await API.Put(SpotifyUrls.LibraryAlbums(), request.BuildQueryParams(), null).ConfigureAwait(false);

            return(statusCode == HttpStatusCode.Created);
        }
        public async Task <bool> RemoveTracks(LibraryRemoveTracksRequest request)
        {
            Ensure.ArgumentNotNull(request, nameof(request));

            var statusCode = await API.Delete(SpotifyUrls.LibraryTracks(), null, request.BuildBodyParams()).ConfigureAwait(false);

            return(statusCode == HttpStatusCode.OK);
        }
示例#3
0
        public async Task Current()
        {
            var api    = new Mock <IAPIConnector>();
            var client = new UserProfileClient(api.Object);

            await client.Current();

            api.Verify(a => a.Get <PrivateUser>(SpotifyUrls.Me()), Times.Once);
        }
示例#4
0
        public async Task Get()
        {
            var userId = "johnnycrazy";
            var api    = new Mock <IAPIConnector>();
            var client = new UserProfileClient(api.Object);

            await client.Get(userId);

            api.Verify(a => a.Get <PublicUser>(SpotifyUrls.User(userId)), Times.Once);
        }
        public Task <Paging <SavedTrack> > GetTracks(LibraryTracksRequest request)
        {
            Ensure.ArgumentNotNull(request, nameof(request));

            return(API.Get <Paging <SavedTrack> >(SpotifyUrls.LibraryTracks(), request.BuildQueryParams()));
        }
 public Task <Paging <SavedTrack> > GetTracks()
 {
     return(API.Get <Paging <SavedTrack> >(SpotifyUrls.LibraryTracks()));
 }
 public Task <Paging <SavedShow> > GetShows()
 {
     return(API.Get <Paging <SavedShow> >(SpotifyUrls.LibraryShows()));
 }
 public Task <Paging <SavedAlbum> > GetAlbums()
 {
     return(API.Get <Paging <SavedAlbum> >(SpotifyUrls.LibraryAlbums()));
 }
        public Task <List <bool> > CheckTracks(LibraryCheckTracksRequest request)
        {
            Ensure.ArgumentNotNull(request, nameof(request));

            return(API.Get <List <bool> >(SpotifyUrls.LibraryTracksContains(), request.BuildQueryParams()));
        }
示例#10
0
 public Task <Paging <SavedEpisodes> > GetEpisodes()
 {
     return(API.Get <Paging <SavedEpisodes> >(SpotifyUrls.LibraryEpisodes()));
 }
        public Task <PublicUser> Get(string userId)
        {
            Ensure.ArgumentNotNullOrEmptyString(userId, nameof(userId));

            return(API.Get <PublicUser>(SpotifyUrls.User(userId)));
        }
 public Task <PrivateUser> Current()
 {
     return(API.Get <PrivateUser>(SpotifyUrls.Me()));
 }