public async Task <IActionResult> Episode(Guid id, Guid show, Guid season, string category, string section, string subsection) { var seasonSelect = await _unitOfWork.TVShowControl.GetSeason(season); var showSelect = await _unitOfWork.TVShowControl.GetTVShow(show); var genreSelect = await _unitOfWork.TVShowControl.GetGenre(id); ViewBag.Gid = id; ViewBag.Sid = show; ViewBag.Sig = season; ViewBag.GenreName = genreSelect.Genre; ViewBag.ShowName = showSelect.TVShowTitle; ViewBag.SeasonName = seasonSelect.TVShowSeasonNumber; ViewBag.UrlGenre = FilePathUrlHelper.UrlString(genreSelect.Genre); ViewBag.UrlSection = FilePathUrlHelper.UrlString(showSelect.TVShowTitle); ViewBag.UrlSubsection = seasonSelect.TVShowSeasonNumber.ToString(); var model = await _unitOfWork.TVShowControl.GetSeasonEpisodes(id, show, season); model.CategoryId = id; model.TVShowId = show; model.SeasonId = season; return(View(model)); }
public async Task <IActionResult> AddTVShowSeason(Guid id, Guid show, string category, string section) { // Get Genre Details var genre = await _unitOfWork.TVShowControl.GetGenre(id); var genreName = genre.Genre; // Get Show Details var showValue = await _unitOfWork.TVShowControl.GetTVShow(show); var showTitle = showValue.TVShowTitle; // Get Values from Genre & TV Show and Display in View ViewBag.GenreUrl = FilePathUrlHelper.UrlString(genreName); ViewBag.ShowUrl = FilePathUrlHelper.UrlString(showTitle); ViewBag.Genre = genreName; ViewBag.Gid = id; ViewBag.TVShow = showTitle; ViewBag.TVShowId = show; SectionTVShowSubCategorySeason model = new SectionTVShowSubCategorySeason() { CategoryId = id, TVShowId = show }; return(View(model)); }
public async Task <IEnumerable <SectionRegister> > GetSections(Guid id, string category) { var model = _context.ClamSectionAcademicSubCategories.Any(x => x.AcademicId.Equals(id)); var name = await _context.ClamSectionAcademicCategories.FindAsync(id); List <SectionRegister> list = new List <SectionRegister>(); if (model == true) { var capture = _context.ClamSectionAcademicCategories.Select(x => x.ClamSectionAcademicSubCategories.Where(a => a.AcademicId.Equals(id)).ToList()); var separateVideos = await _context.ClamSectionAcademicSubCategoryItems.ToListAsync(); foreach (var item in capture) { foreach (var content in item) { var subId = content.SubCategoryId; list.Add(new SectionRegister() { SubCategoryId = content.SubCategoryId, SubCategoryTitle = content.SubCategoryTitle, SubCategoryDescription = content.SubCategoryDescription, LastModified = content.LastModified, DateAdded = content.DateAdded, AcademicId = content.AcademicId, UrlCategory = FilePathUrlHelper.UrlString(category), UrlSection = FilePathUrlHelper.UrlString(content.SubCategoryTitle), VideoCount = separateVideos.Select(x => x.SubCategoryId).Where(x => x.Equals(subId)).Count() }); } } return(list); } return(list); }
public async Task <IEnumerable <SectionTVShowCategory> > GetAllGenres() { var genres = await _context.ClamSectionTVShowCategories.ToListAsync(); var shows = await _context.ClamSectionTVShowSubCategories.ToListAsync(); var seasons = await _context.ClamSectionTVShowSubCategorySeasons.ToListAsync(); var episodes = await _context.ClamSectionTVShowSubCategorySeasonItems.ToListAsync(); List <SectionTVShowCategory> model = new List <SectionTVShowCategory>(); foreach (var item in genres) { var idGrab = item.CategoryId; model.Add(new SectionTVShowCategory() { CategoryId = item.CategoryId, Genre = item.Genre, ItemPath = FilePathUrlHelper.DataFilePathFilter(item.ItemPath, 3), //ItemPath = FilePathUrlHelper.DirectoryFilter(item.ItemPath, _data, _rootDir), LastModified = item.LastModified, DateCreated = item.DateCreated, UrlCategory = FilePathUrlHelper.UrlString(item.Genre), SubCategoryCount = shows.Select(x => x.CategoryId).Where(x => x.Equals(idGrab)).Count(), SubCategorySeasonCount = seasons.Select(x => x.CategoryId).Where(x => x.Equals(idGrab)).Count(), SubCategorySeasonItemCount = episodes.Select(x => x.CategoryId).Where(x => x.Equals(idGrab)).Count() }); } return(model); }
public async Task <IEnumerable <SectionAcademicRegister> > GetAllCategories() { var result = await _context.ClamSectionAcademicCategories.ToListAsync(); var subCount = await _context.ClamSectionAcademicSubCategories.ToListAsync(); var subItemCount = await _context.ClamSectionAcademicSubCategoryItems.ToListAsync(); List <SectionAcademicRegister> model = new List <SectionAcademicRegister>(); foreach (var item in result) { var test = item.AcademicId; model.Add(new SectionAcademicRegister() { AcademicId = item.AcademicId, AcademicDisciplineTitle = item.AcademicDisciplineTitle, AcademicDisciplineDescription = item.AcademicDisciplineDescription, LastModified = item.LastModified, DateAdded = item.DateAdded, UrlCategory = FilePathUrlHelper.UrlString(item.AcademicDisciplineTitle), SubCategoryCount = subCount.Select(x => x.AcademicId).Where(x => x.Equals(test)).Count(), SubCategoryItemCount = subItemCount.Select(x => x.AcademicId).Where(x => x.Equals(test)).Count() }); } return(model); }
public async Task <IActionResult> EditTVShowSeason(Guid id, Guid show, Guid season, string category, string section, string subsection) { var model = await _unitOfWork.TVShowControl.GetSeason(season); if (model.CategoryId == id && model.TVShowId == show && model.SeasonId == season) { var genre = await _unitOfWork.TVShowControl.GetGenre(id); var genreName = genre.Genre; ViewBag.Genre = genreName; ViewBag.GenreUrl = FilePathUrlHelper.UrlString(genreName); // Get Show Details var showValue = await _unitOfWork.TVShowControl.GetTVShow(show); var showTitle = showValue.TVShowTitle; ViewBag.Show = showTitle; ViewBag.ShowUrl = FilePathUrlHelper.UrlString(showTitle); ViewBag.SeasonId = season; ViewBag.SeasonNumber = model.TVShowSeasonNumber; ViewBag.Gid = model.CategoryId; ViewBag.TVShowId = model.TVShowId; ViewBag.Episodes = model.SubCategorySeasonItemCount; return(View(model)); } return(RedirectToAction(nameof(TVShowSeasons), new { Id = id, Show = show })); }
public async Task <StreamFileUploadDatabase> GetSectionEpisodes(Guid id, Guid sub, string category, string section) { var model = await _context.ClamSectionAcademicSubCategoryItems.AsNoTracking().ToListAsync(); List <SectionItem> result = new List <SectionItem>(); foreach (var item in model) { if (item.SubCategoryId == sub && item.AcademicId == id) { result.Add(new SectionItem() { ItemId = item.ItemId, ItemTitle = FilePathUrlHelper.GetFileName(item.ItemTitle), ItemPath = item.ItemPath, ItemDescription = item.ItemDescription, LastModified = item.LastModified, DateAdded = item.DateAdded, Size = item.Size, UrlCategory = category, UrlSection = section, UrlSectionItem = FilePathUrlHelper.UrlString(FilePathUrlHelper.GetFileName(item.ItemTitle)) }); } } StreamFileUploadDatabase episodes = new StreamFileUploadDatabase() { SectionItems = result }; episodes.AcademicId = id; episodes.SubCategoryId = sub; return(episodes); }
public async Task <IActionResult> CategoryDetails(Guid id, string category) { var model = await _unitOfWork.AcademiaControl.GetCategory(id); ViewBag.Name = model.AcademicDisciplineTitle; ViewBag.UrlGenre = FilePathUrlHelper.UrlString(model.AcademicDisciplineTitle); return(View(model)); }
public async Task <IActionResult> AddTVShow(Guid id, string category) { var model = await _unitOfWork.TVShowControl.GetGenre(id); var genre = model.Genre; ViewBag.UrlGenre = FilePathUrlHelper.UrlString(model.Genre); ViewBag.Genre = genre; ViewBag.Gid = id; return(View()); }
public async Task <IActionResult> Section(Guid id, string category) { var model = await _unitOfWork.AcademiaControl.GetSections(id, category); var getName = await _unitOfWork.AcademiaControl.GetCategory(id); ViewBag.Aid = id; ViewBag.CategoryName = getName.AcademicDisciplineTitle; ViewBag.UrlCategory = FilePathUrlHelper.UrlString(category); return(View(model)); }
public void UrlString_ConvertParameterStringForEndPointUrl_ReturnsEqual() { //Arrange string testParameter = "controller Action ID ParaMEteRS"; string expectedResult = "controller-action-id-parameters"; //Act var result = FilePathUrlHelper.UrlString(testParameter); //Assert Assert.AreEqual(expectedResult, result); }
public async Task <IActionResult> Video(Guid id, Guid show, Guid season, Guid data, string category, string section, string subsection, string subsectionitem) { var status = false; ViewBag.Gid = id; ViewBag.Sid = show; ViewBag.Sig = season; ViewBag.Vid = data; var seasonSelect = await _unitOfWork.TVShowControl.GetSeason(season); var showSelect = await _unitOfWork.TVShowControl.GetTVShow(show); var genreSelect = await _unitOfWork.TVShowControl.GetGenre(id); var episodeSelect = await _unitOfWork.TVShowControl.GetEpisode(data); ViewBag.Video = FilePathUrlHelper.GetFileName(episodeSelect.ItemTitle); ViewBag.SeasonName = seasonSelect.TVShowSeasonNumber; ViewBag.ShowName = showSelect.TVShowTitle; ViewBag.GenreName = genreSelect.Genre; ViewBag.UrlGenre = FilePathUrlHelper.UrlString(genreSelect.Genre); ViewBag.UrlSection = FilePathUrlHelper.UrlString(showSelect.TVShowTitle); ViewBag.UrlSubsection = seasonSelect.TVShowSeasonNumber.ToString(); ViewBag.UrlSubsectionItem = FilePathUrlHelper.GetFileName(FilePathUrlHelper.UrlString(episodeSelect.ItemTitle)); List <SelectListItem> episodes = new List <SelectListItem>(); var model = await _unitOfWork.TVShowControl.GetSeasonEpisodes(id, show, season); foreach (var item in model.Episodes) { if (item.CategoryId == id && item.TVShowId == show && item.SeasonId == season && item.ItemId == data) { status = true; episodes.Add(new SelectListItem() { Text = item.ItemTitle, Value = item.ItemPath, }); } } if (status == true) { var result = await _unitOfWork.TVShowControl.GetEpisode(data); //ViewBag.Title = GetFileName(result.ItemPath); ViewBag.Title = result.ItemTitle; ViewBag.Episodes = episodes; ViewBag.Path = FilePathUrlHelper.DataFilePathFilter(result.ItemPath, 3); return(View(result)); } return(RedirectToAction(nameof(Episode), new { Id = id, Show = show, Season = season })); }
public async Task <IActionResult> CreateSection(Guid id, string category) { //var name = _context.Set<ClamSectionAcademicCategory>().Find(id); var model = await _unitOfWork.AcademiaControl.GetCategory(id); var categoryTitle = model.AcademicDisciplineTitle; ViewBag.UrlCategory = FilePathUrlHelper.UrlString(category); ViewBag.CategoryName = categoryTitle; ViewBag.Category = categoryTitle; ViewBag.Aid = id; return(View()); }
public async Task <IActionResult> DeleteTVShow(Guid id, string category, string section) { var model = await _unitOfWork.TVShowControl.GetTVShow(id); var genreDetail = await _unitOfWork.TVShowControl.GetGenre(model.CategoryId); ViewBag.Gid = model.CategoryId; ViewBag.Name = model.TVShowTitle; ViewBag.TVShowId = model.TVShowId; ViewBag.Genre = genreDetail.Genre; ViewBag.UrlGenre = FilePathUrlHelper.UrlString(genreDetail.Genre); return(View(model)); }
public async Task <IActionResult> SectionDetails(Guid id, string category, string section) { var model = await _unitOfWork.AcademiaControl.GetSelectedSection(id); var categoryName = await _unitOfWork.AcademiaControl.GetCategory(model.AcademicId); ViewBag.Aid = model.AcademicId; ViewBag.Name = model.SubCategoryTitle; ViewBag.SectionName = model.SubCategoryTitle; ViewBag.CategoryName = categoryName.AcademicDisciplineTitle; ViewBag.UrlCategory = FilePathUrlHelper.UrlString(category); ViewBag.UrlSection = FilePathUrlHelper.UrlString(section); return(View(model)); }
public async Task <IActionResult> Episode(Guid id, Guid said, string category, string section) { ViewBag.Aid = id; ViewBag.Said = said; ViewBag.UrlCategory = FilePathUrlHelper.UrlString(category); ViewBag.UrlSection = FilePathUrlHelper.UrlString(section); var modelCategory = await _unitOfWork.AcademiaControl.GetCategory(id); var modelSection = await _unitOfWork.AcademiaControl.GetSelectedSection(said); ViewBag.CategoryName = modelCategory.AcademicDisciplineTitle; ViewBag.SectionName = modelSection.SubCategoryTitle; var model = await _unitOfWork.AcademiaControl.GetSectionEpisodes(id, said, category, section); return(View(model)); }
public async Task <IActionResult> TVShowSeasons(Guid id, Guid show, string category, string section) { var showSelect = await _unitOfWork.TVShowControl.GetTVShow(show); var genreSelect = await _unitOfWork.TVShowControl.GetGenre(id); ViewBag.Gid = id; ViewBag.Show = show; ViewBag.Name = showSelect.TVShowTitle; ViewBag.Genre = genreSelect.Genre; ViewBag.UrlCategory = FilePathUrlHelper.UrlString(genreSelect.Genre); ViewBag.UrlSection = FilePathUrlHelper.UrlString(showSelect.TVShowTitle); var model = await _unitOfWork.TVShowControl.GetTVShowSeasons(id, show); return(View(model)); }
public async Task <IActionResult> DeleteTVShowSeason(Guid id, Guid show, Guid season, string category, string section, string subsection) { var model = await _unitOfWork.TVShowControl.GetSeason(season); var episodes = await _unitOfWork.TVShowControl.GetSeasonEpisodes(id, show, season); if (model.CategoryId == id && model.TVShowId == show && model.SeasonId == season) { SectionTVShowSubCategorySeason retrieveModel = new SectionTVShowSubCategorySeason() { SeasonId = model.SeasonId, TVShowSeasonNumber = model.TVShowSeasonNumber, ItemPath = model.ItemPath, LastModified = model.LastModified, DateCreated = model.DateCreated, CategoryId = model.CategoryId, TVShowId = model.TVShowId, SubCategorySeasonItemCount = episodes.Episodes.Count }; var genre = await _unitOfWork.TVShowControl.GetGenre(id); var genreName = genre.Genre; ViewBag.Genre = genreName; ViewBag.GenreUrl = FilePathUrlHelper.UrlString(genreName); // Get Show Details var showValue = await _unitOfWork.TVShowControl.GetTVShow(show); var showTitle = showValue.TVShowTitle; ViewBag.Show = showTitle; ViewBag.ShowUrl = FilePathUrlHelper.UrlString(showTitle); ViewBag.SeasonId = season; ViewBag.SeasonNumber = model.TVShowSeasonNumber; ViewBag.Gid = model.CategoryId; ViewBag.TVShowId = model.TVShowId; ViewBag.Episodes = model.SubCategorySeasonItemList; return(View(retrieveModel)); } return(RedirectToAction(nameof(TVShowSeasons), new { Id = id, Show = show })); }
public async Task <StreamTVShowFileUploadDatabase> GetSeasonEpisodes(Guid id, Guid show, Guid season) { var seasonSelect = await _context.ClamSectionTVShowSubCategorySeasons.FindAsync(season); var showSelect = await _context.ClamSectionTVShowSubCategories.FindAsync(show); var genreSelect = await _context.ClamSectionTVShowCategories.FindAsync(id); var model = await _context.ClamSectionTVShowSubCategorySeasonItems.AsNoTracking().ToListAsync(); List <SectionTVShowSubCategorySeasonItem> result = new List <SectionTVShowSubCategorySeasonItem>(); foreach (var item in model) { if (item.CategoryId == id && item.TVShowId == show && item.SeasonId == season) { result.Add(new SectionTVShowSubCategorySeasonItem() { ItemId = item.ItemId, ItemPath = item.ItemPath, ItemTitle = FilePathUrlHelper.GetFileName(item.ItemTitle), Size = item.Size, LastModified = item.LastModified, DateCreated = item.DateCreated, CategoryId = item.CategoryId, TVShowId = item.TVShowId, SeasonId = item.SeasonId, UrlCategory = FilePathUrlHelper.UrlString(genreSelect.Genre), UrlSection = FilePathUrlHelper.UrlString(showSelect.TVShowTitle), UrlSubSection = seasonSelect.TVShowSeasonNumber.ToString(), UrlSubSectionItem = FilePathUrlHelper.UrlString(FilePathUrlHelper.GetFileName(item.ItemTitle)) }); } } StreamTVShowFileUploadDatabase episodes = new StreamTVShowFileUploadDatabase() { Episodes = result }; return(episodes); }
public async Task <IActionResult> Video(Guid id, Guid said, Guid data, string category, string section, string sectionitem) { var status = false; ViewBag.Data = data; ViewBag.Said = said; ViewBag.Aid = id; ViewBag.UrlCategory = FilePathUrlHelper.UrlString(category); ViewBag.UrlSection = FilePathUrlHelper.UrlString(section); ViewBag.UrlSectionItem = FilePathUrlHelper.UrlString(sectionitem); List <SelectListItem> episdoes = new List <SelectListItem>(); var model = await _unitOfWork.AcademiaControl.GetAllEpisodes(); foreach (var item in model) { if (item.AcademicId == id && item.SubCategoryId == said && item.ItemId == data) { status = true; } if (item.SubCategoryId == said) { episdoes.Add(new SelectListItem() { Text = FilePathUrlHelper.GetFileName(item.ItemTitle), Value = item.ItemPath }); } } if (status == true) { var result = await _unitOfWork.AcademiaControl.GetVideo(data); ViewBag.Title = FilePathUrlHelper.GetFileName(result.ItemTitle); ViewBag.Episodes = episdoes; ViewBag.Path = FilePathUrlHelper.DataFilePathFilter(result.ItemPath, 3); return(View(result)); } return(RedirectToAction(nameof(Episode), new { Id = id, Said = said, Category = category, Section = section })); }
public async Task <IEnumerable <SectionTVShowSubCategory> > GetGenreTVShows(Guid id) { var model = _context.Set <ClamSectionTVShowSubCategory>().Any(x => x.CategoryId.Equals(id)); List <SectionTVShowSubCategory> list = new List <SectionTVShowSubCategory>(); if (model == true) { var genre = await _context.ClamSectionTVShowCategories.FindAsync(id); var capture = _context.Set <ClamSectionTVShowCategory>().Select(x => x.ClamSectionTVShowSubCategories .Where(a => a.CategoryId.Equals(id)).ToList()); var filterSeasons = _context.ClamSectionTVShowSubCategorySeasons.ToList(); var filterSeasonEpisodes = _context.ClamSectionTVShowSubCategorySeasonItems.ToList(); foreach (var item in capture) { foreach (var content in item) { var TVShowId = content.TVShowId; list.Add(new SectionTVShowSubCategory() { TVShowId = content.TVShowId, TVShowTitle = content.TVShowTitle, TVShowSeasonNumberTotal = content.TVShowSeasonNumberTotal, ItemPath = FilePathUrlHelper.DataFilePathFilter(content.ItemPath, 3), LastModified = content.LastModified, DateCreated = content.DateCreated, CategoryId = content.CategoryId, UrlCategory = FilePathUrlHelper.UrlString(genre.Genre), UrlSection = FilePathUrlHelper.UrlString(content.TVShowTitle), SubCategorySeasonCount = filterSeasons.Select(x => x.TVShowId).Where(x => x.Equals(TVShowId)).Count(), SubCategorySeasonItemCount = filterSeasonEpisodes.Select(x => x.TVShowId).Where(x => x.Equals(TVShowId)).Count() }); } } return(list); } return(list); }
public async Task <IEnumerable <SectionTVShowSubCategorySeason> > GetTVShowSeasons(Guid id, Guid show) { var model = await _context.ClamSectionTVShowSubCategorySeasons.AsNoTracking().ToListAsync(); var episodes = await _context.ClamSectionTVShowSubCategorySeasonItems.AsNoTracking().ToListAsync(); var listTitleNames = await _context.ClamSectionTVShowSubCategories.AsNoTracking().ToListAsync(); var showSelect = await _context.ClamSectionTVShowSubCategories.FindAsync(show); var genreSelect = await _context.ClamSectionTVShowCategories.FindAsync(id); List <SectionTVShowSubCategorySeason> result = new List <SectionTVShowSubCategorySeason>(); foreach (var item in model) { if (item.TVShowId == show && item.CategoryId == id) { var idGrab = item.SeasonId; result.Add(new SectionTVShowSubCategorySeason() { SeasonId = item.SeasonId, TVShowSeasonNumber = item.TVShowSeasonNumber, ItemPath = FilePathUrlHelper.DataFilePathFilter(item.ItemPath, 3), LastModified = item.LastModified, DateCreated = item.DateCreated, CategoryId = item.CategoryId, TVShowId = item.TVShowId, UrlCategory = FilePathUrlHelper.UrlString(genreSelect.Genre), UrlSection = FilePathUrlHelper.UrlString(showSelect.TVShowTitle), UrlSubSection = item.TVShowSeasonNumber.ToString(), SubCategorySeasonItemCount = episodes.Select(x => x.SeasonId).Where(x => x.Equals(idGrab)).Count() }); } } return(result); }