public ActionResult RecentMediaItems(int skip = 0, int count = 0, string order = "created", string mediaType = "") { if (!Services.Authorizer.Authorize(Permissions.ManageOwnMedia)) { Services.Notifier.Add(UI.Notify.NotifyType.Error, T("Cannot view media")); return(new HttpUnauthorizedResult()); } var rootMediaFolder = _mediaLibraryService.GetRootMediaFolder(); var rootMediaFolderPath = rootMediaFolder == null ? null : rootMediaFolder.MediaPath; var mediaParts = _mediaLibraryService.GetMediaContentItemsRecursive(rootMediaFolderPath, skip, count, order, mediaType); var mediaPartsCount = _mediaLibraryService.GetMediaContentItemsCountRecursive(rootMediaFolderPath, mediaType); var mediaItems = mediaParts.Select(x => new MediaManagerMediaItemViewModel { MediaPart = x, Shape = Services.ContentManager.BuildDisplay(x, "Thumbnail") }).ToList(); var viewModel = new MediaManagerMediaItemsViewModel { MediaItems = mediaItems, MediaItemsCount = mediaPartsCount }; return(View("MediaItems", viewModel)); }