Example #1
0
        public Task <IEnumerable <ITrack> > GetAlbumTracks(IAlbum album, CancellationToken cancellationToken, uint start = 0, uint count = 50)
        {
            album.ThrowIfNull();

            if (album is Album albumImpl)
            {
                bool hasTracklist       = albumImpl.TracklistInternal != null;
                bool tracklistPopulated = hasTracklist && albumImpl.TracklistInternal.Any();

                if (hasTracklist && tracklistPopulated)
                {
                    return(Task.FromResult <IEnumerable <ITrack> >(albumImpl.TracklistInternal.Skip((int)start)
                                                                   .Take((int)count)
                                                                   .ToList()));
                }
            }

            return(GetAlbumTracks(album.Id, cancellationToken, start, count));
        }
Example #2
0
        public Task <IEnumerable <IComment> > GetAlbumComments(IAlbum album, CancellationToken cancellationToken, uint start = 0, uint count = 10)
        {
            album.ThrowIfNull();

            return(GetAlbumComments(album.Id, cancellationToken, start, count));
        }
Example #3
0
        public Task <bool> RateAlbum(IAlbum album, DeezerRating rating, CancellationToken cancellationToken)
        {
            album.ThrowIfNull();

            return(RateAlbum(album.Id, rating, cancellationToken));
        }
Example #4
0
        public Task <ulong> AddComment(IAlbum album, string commentText, CancellationToken cancellationToken)
        {
            album.ThrowIfNull();

            return(AddComment(album.Id, commentText, cancellationToken));
        }
Example #5
0
        public Task <bool> UnfavouriteAlbum(IAlbum album, CancellationToken cancellationToken)
        {
            album.ThrowIfNull();

            return(UnfavouriteAlbum(album.Id, cancellationToken));
        }