Пример #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()));
 }