예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #5
0
        public Task <Paging <SavedTrack> > GetTracks(LibraryTracksRequest request)
        {
            Ensure.ArgumentNotNull(request, nameof(request));

            return(API.Get <Paging <SavedTrack> >(SpotifyUrls.LibraryTracks(), request.BuildQueryParams()));
        }
예제 #6
0
 public Task <Paging <SavedTrack> > GetTracks()
 {
     return(API.Get <Paging <SavedTrack> >(SpotifyUrls.LibraryTracks()));
 }
예제 #7
0
 public Task <Paging <SavedShow> > GetShows()
 {
     return(API.Get <Paging <SavedShow> >(SpotifyUrls.LibraryShows()));
 }
예제 #8
0
 public Task <Paging <SavedAlbum> > GetAlbums()
 {
     return(API.Get <Paging <SavedAlbum> >(SpotifyUrls.LibraryAlbums()));
 }
예제 #9
0
        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()));
 }