public async Task <IActionResult> DeletedItems() { DeletedViewModel model = new DeletedViewModel(); model.TvItems = await _tvItemService.FetchTvItemsAsync(true); model.ZombieFiles = await _fileService.FindZombieFilesAsync(); model.TotalUndeletedFileSize = model.TvItems.Sum(x => Utils.GetTotalFileSizeLong(x)); return(View(model)); }
// GET: TvItems public async Task <IActionResult> Index() { List <TvItem> tvItems = await _tvItemService.FetchTvItemsAsync(false); var model = new TvItemsViewModel(); // these active items list contains items that were not yet played on tv screens model.ActiveTvItems = tvItems.Where(x => DateTime.Compare(DateTime.Now, x.EndTime) < 0).ToList(); model.ExpiredTvItems = tvItems.Where(x => !model.ActiveTvItems.Select(y => y.ID).Contains(x.ID)).ToList(); return(View(model)); }