public Task <HttpContent> StreamTrack(TrackStreamRequest 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.StreamTrack(request)); }
public static async Task <Stream> StreamTrackAsStream(this IMonstercatApi api, TrackStreamRequest request) { var content = await api.StreamTrack(request).ConfigureAwait(false); return(await content.ReadAsStreamAsync().ConfigureAwait(false)); }