/// <summary> /// Executes this command. /// </summary> /// <param name="request">A filter to search for specific media items/folders.</param> /// <returns>A list of tags.</returns> public MediaManagerItemsViewModel Execute(MediaManagerViewModel request) { request.SetDefaultSortingOptions("Title"); var items = GetAllItemsList(request); var model = new MediaManagerItemsViewModel(items.Item1, request, items.Item2); model.Path = LoadMediaFolder(request); return(model); }
/// <summary> /// Executes this command. /// </summary> /// <param name="request">A filter to search for specific media items/folders.</param> /// <returns>A list of tags.</returns> public MediaManagerItemsViewModel Execute(MediaManagerViewModel request) { request.SetDefaultSortingOptions("Title"); var items = GetAllItemsList(request); var model = new MediaManagerItemsViewModel(items.Item1, request, items.Item2); model.Path = LoadMediaFolder(request); model.Tags = request.Tags; model.Categories = request.Categories; model.CategoriesLookupList = CategoryService.GetCategoriesLookupList(MediaFile.CategorizableItemKeyForFiles); return(model); }
/// <summary> /// Executes this command. /// </summary> /// <param name="request">A filter to search for specific media items/folders.</param> /// <returns>A list of tags.</returns> public MediaManagerItemsViewModel Execute(MediaManagerViewModel request) { request.SetDefaultSortingOptions("Title"); IEnumerable <MediaViewModel> results; var folders = GetFolders(request); var items = GetItemsList(request); if (request.Direction == SortDirection.Descending) { results = items.Cast <MediaViewModel>().Concat(folders); } else { results = folders.Cast <MediaViewModel>().Concat(items); } var model = new MediaManagerItemsViewModel(results, request, results.Count()); model.Path = LoadMediaFolder(request); return(model); }