private void SearchMediaItems(RequestPagingItemsEventArgs e) { if (_currentPreviewItem != null) { _currentPreviewItem.ClosePreview(); _currentPreviewItem = null; } _mediaItemCollection.Clear(); var result = MediaFileService.GetMediaFiles(this.SearchOptions, e.PagingInfo); foreach (var item in result.Items) { _mediaItemCollection.Add(new BindableFileMediaItem(item, this.ResolvePath(item.FileName))); } e.Result = result; }
public async Task <IActionResult> GetFiles(string path, bool includeSubFolders) { return(Ok(await Task.Run(() => _mediaFileServices.GetMediaFiles(path, includeSubFolders).OrderByDescending(f => f.SizeInGb)))); }