public ActionResult Index() { IEnumerable <Video> videos = null; if (UsersHelper.LoggedInUserIsAdmin(Session)) { videos = _videosRepository.GetNRandomVideos(6); } else { videos = _videosRepository.GetNRandomPublicVideos(6); } IEnumerable <VideoDTO> vdto = VideoDTO.ConvertCollectionVideoToDTO(videos); return(View(vdto)); }
public ActionResult VideoPageRecommended(long?id) { IEnumerable <Video> videos = null; var userType = (string)Session["loggedInUserUserType"]; if (userType == "ADMIN") { videos = _videosRepository.GetNRandomVideosWithout(6, (long)id); } else { videos = _videosRepository.GetNRandomPublicVideosWithout(6, (long)id); } IEnumerable <VideoDTO> videosDTO = VideoDTO.ConvertCollectionVideoToDTO(videos); return(PartialView(videosDTO)); }
public ActionResult ChannelPageVideosPartial(string channelName, bool?ownedOrLikedVideos, string sortOrder) { IEnumerable <Video> videos = null; if (ownedOrLikedVideos == true) { ViewBag.SelectedView = "PostedVideos"; ViewBag.SortValues = Video.VideosSortOrderSelectList(); videos = VideosPostedBy(channelName); ViewBag.SortOrder = String.IsNullOrEmpty(sortOrder) ? "latest" : ""; videos = SortVideos(videos, sortOrder); } else { videos = VideosLikedBy(channelName); } var videosDTO = VideoDTO.ConvertCollectionVideoToDTO(videos); return(PartialView(videosDTO)); }