Ejemplo n.º 1
0
        /// <summary>
        /// gold membership required
        /// </summary>
        public Task <HttpContent> DownloadTrack(TrackDownloadRequest request)
        {
            if (request is null)
            {
                throw new ArgumentNullException(nameof(request));
            }

            if (request.ReleaseId == Guid.Empty)
            {
                throw new ArgumentException(nameof(TrackDownloadRequest.ReleaseId));
            }

            if (request.TrackId == Guid.Empty)
            {
                throw new ArgumentException(nameof(TrackDownloadRequest.TrackId));
            }

            return(_service.DownloadTrack(request));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// gold membership required
        /// </summary>
        public static async Task <Stream> DownloadTrackAsStream(this IMonstercatApi api, TrackDownloadRequest request)
        {
            var content = await api.DownloadTrack(request).ConfigureAwait(false);

            return(await content.ReadAsStreamAsync().ConfigureAwait(false));
        }