public async Task <IActionResult> Get()
        {
            var entries = await _store.GetAsync(CancellationToken);

            // FIXME: directly stream the headers to avoid streaming the whole payload as well
            return(Ok(entries.Select(x => new MediaEntryViewModel
            {
                Uuid = x.Uuid,
                Type = x.Type,
                Length = x.Length,
                Name = x.Name
            })));
        }
Beispiel #2
0
        public async Task <IActionResult> Download(string appId, string fileName, [FromQuery] MediaFileQueryDto?query = null)
        {
            var media = await mediaStore.GetAsync(appId, fileName, HttpContext.RequestAborted);

            return(DeliverAsset(appId, media, query));
        }