Exemplo n.º 1
0
        public ActionResult Contest(string key)
        {
            contest = new Contest();

            contest.GetContestByKey(key);

            ContestVideos convids = new ContestVideos();

            convids.GetContestVideosForContest(contest.ContestID);

            ViewBag.ContestName = contest.Name;

            SongRecords sngrcs = new SongRecords();
            SongRecord sngrcd = null;
            BootBaronLib.AppSpec.DasKlub.BOL.Video vidCon = null;

            foreach (BootBaronLib.AppSpec.DasKlub.BOL.VideoContest.ContestVideo vi in convids)
            {
                vidCon = new BootBaronLib.AppSpec.DasKlub.BOL.Video(vi.VideoID);

                sngrcd = new SongRecord(vidCon);

                sngrcs.Add(sngrcd);
            }

            sngrcs.Sort(delegate(BootBaronLib.AppSpec.DasKlub.BOL.ArtistContent.SongRecord p1,
            BootBaronLib.AppSpec.DasKlub.BOL.ArtistContent.SongRecord p2)
            {
                return p2.VideoID.CompareTo(p1.VideoID);
            });

            return View(sngrcs);
        }
Exemplo n.º 2
0
        public ActionResult Contest(string key)
        {
            _contest = new Contest();
            _contest.GetContestByKey(key);
            var convids = new ContestVideos();
            convids.GetContestVideosForContest(_contest.ContestID);
            ViewBag.ContestName = _contest.Name;
            var sngrcs = new SongRecords();
            sngrcs.AddRange(convids.Select(vi => new Video(vi.VideoID)).Select(vidCon => new SongRecord(vidCon)));
            sngrcs.Sort((p1, p2) => p2.VideoID.CompareTo(p1.VideoID));

            return View(sngrcs);
        }
Exemplo n.º 3
0
        private static void VideoCount()
        {
            var vids = new Videos();
            var conts = new Contests();
            conts.GetAll();

            int count = 0;
            int totalVids = 0;

            foreach (Contest c1 in conts)
            {
                var cv = new ContestVideo();
                var cvs = new ContestVideos();
                cvs.GetContestVideosForContest(c1.ContestID);
                totalVids += cvs.Count;
                count += (from cv2 in cvs
                    select new Video(cv2.VideoID)
                    into v1
                    let doc = new XmlDocument()
                    select
                        Utilities.GETRequest(
                            new Uri("http://gdata.youtube.com/feeds/api/videos/" + v1.ProviderKey +
                                    @"?v=2&alt=json"))
                    into s
                    where !string.IsNullOrWhiteSpace(s)
                    select (JObject) JsonConvert.DeserializeObject(s)
                    into JObj
                    select JObj["entry"]
                    into entry
                    from thumbnail in entry["yt$statistics"]
                    where !thumbnail.ToString().Contains("fav")
                    select
                        Convert.ToInt32(thumbnail.ToString()
                            .Replace(@"""viewCount"": """, string.Empty)
                            .Replace(@"""", string.Empty))).Sum();
            }
        }
Exemplo n.º 4
0
        public ActionResult VideoVote()
        {
            Contest contest = Contest.GetLastContest();

            ViewBag.Contest = contest;

            mu = Membership.GetUser();

            if (ContestVideo.IsUserContestVoted(Convert.ToInt32(mu.ProviderUserKey), contest.ContestID)  && contest.DeadLine.AddHours(72) > DateTime.UtcNow)
            {
                LoadContestResults();

                return View();
            }

            ContestVideos cvids = new ContestVideos();

            cvids.GetContestVideosForContest(contest.ContestID);

            Videos vidsInContest = new Videos();
            Video vid2 = null;

            foreach (ContestVideo cv1 in cvids)
            {
                vid2 = new Video(cv1.VideoID);
                vidsInContest.Add(vid2);

            }

            vidsInContest.Sort(delegate(Video p1, Video p2)
                            {
                                return p1.PublishDate.CompareTo(p2.PublishDate);
                            });

            ViewBag.ContestVideos = vidsInContest;

            //SongRecords sngrcds3 = new SongRecords();
            //SongRecord sng3 = new SongRecord();

            //foreach (Video v1 in vidsInContest)
            //{
            //    sng3 = new SongRecord(v1);

            //    sngrcds3.Add(sng3);
            //}

            //ViewBag.ContestVideoList = sngrcds3.VideosList();

            return View();
        }
Exemplo n.º 5
0
        public ActionResult VideoVote()
        {
            Contest contest = Contest.GetLastContest();

            ViewBag.Contest = contest;

            if (_mu != null &&
                (ContestVideo.IsUserContestVoted(Convert.ToInt32(_mu.ProviderUserKey), contest.ContestID) &&
                 contest.DeadLine.AddHours(72) > DateTime.UtcNow))
            {
                LoadContestResults();

                return View();
            }

            var cvids = new ContestVideos();

            cvids.GetContestVideosForContest(contest.ContestID);

            var vidsInContest = new Videos();
            vidsInContest.AddRange(cvids.Select(cv1 => new Video(cv1.VideoID)));

            vidsInContest.Sort((p1, p2) => p1.PublishDate.CompareTo(p2.PublishDate));

            ViewBag.ContestVideos = vidsInContest;

            return View();
        }
Exemplo n.º 6
0
        public ActionResult Index()
        {
            // CONTESTS

            Contest cndss = Contest.GetCurrentContest();
            ContestVideos cvids = new ContestVideos();

            Videos vidsInContest = new Videos();
            BootBaronLib.AppSpec.DasKlub.BOL.Video vid2 = null;

            foreach (ContestVideo cv1 in cvids)
            {
                vid2 = new BootBaronLib.AppSpec.DasKlub.BOL.Video(cv1.VideoID);
                vidsInContest.Add(vid2);
            }

            vidsInContest.Sort(delegate(BootBaronLib.AppSpec.DasKlub.BOL.Video p1, BootBaronLib.AppSpec.DasKlub.BOL.Video p2)
            {
                return p2.PublishDate.CompareTo(p1.PublishDate);
            });

            SongRecords sngrcds3 = new SongRecords();
            SongRecord sng3 = new SongRecord();

            foreach (BootBaronLib.AppSpec.DasKlub.BOL.Video v1 in vidsInContest)
            {
                sng3 = new SongRecord(v1);

                sngrcds3.Add(sng3);
            }

            ViewBag.ContestVideoList = sngrcds3.VideosList();
            ViewBag.CurrentContest = cndss;

            //
            PhotoItems pitms = new PhotoItems();
            pitms.UseThumb = true;
            pitms.ShowTitle = false;
            pitms.GetPhotoItemsPageWise(1, 4);

            ViewBag.PhotoList = pitms.ToUnorderdList;

            Contents cnts = new Contents();
            cnts.GetContentPageWiseAll(1, 3);

            ViewBag.RecentArticles = cnts.ToUnorderdList;

            UserAccounts uas = new UserAccounts();
            uas.GetNewestUsers();
            ViewBag.NewestUsers = uas.ToUnorderdList;

            Videos newestVideos = new Videos();
            newestVideos.GetMostRecentVideos();
            SongRecords newSongs = new SongRecords();
            SongRecord sng1 = null;
            foreach (BootBaronLib.AppSpec.DasKlub.BOL.Video v1 in newestVideos)
            {
                sng1 = new SongRecord(v1);
                newSongs.Add(sng1);
            }

            ViewBag.NewestVideos = newSongs.VideosList();

            BootBaronLib.AppSpec.DasKlub.BOL.Video vid = new BootBaronLib.AppSpec.DasKlub.BOL.Video(BootBaronLib.AppSpec.DasKlub.BOL.Video.RandomVideoIDVideo());

            ViewBag.RandomVideoKey = vid.ProviderKey;

            ///video submit
            MultiProperties addList = null;
            PropertyType propTyp = null;
            MultiProperties mps = null;

            // video typesa
            propTyp = new PropertyType(SiteEnums.PropertyTypeCode.VIDTP);
            mps = new MultiProperties(propTyp.PropertyTypeID);
            mps.Sort(delegate(MultiProperty p1, MultiProperty p2)
            {
                return p1.DisplayName.CompareTo(p2.DisplayName);
            });

            ViewBag.VideoTypes = mps;

            // person types
            propTyp = new PropertyType(SiteEnums.PropertyTypeCode.HUMAN);
            mps = new MultiProperties(propTyp.PropertyTypeID);
            mps.Sort(delegate(MultiProperty p1, MultiProperty p2)
            {
                return p1.DisplayName.CompareTo(p2.DisplayName);
            });

            ViewBag.PersonTypes = mps;

            //// footage types
            propTyp = new PropertyType(SiteEnums.PropertyTypeCode.FOOTG);
            mps = new MultiProperties(propTyp.PropertyTypeID);
            mps.Sort(delegate(MultiProperty p1, MultiProperty p2)
            {
                return p1.DisplayName.CompareTo(p2.DisplayName);
            });
            addList = new MultiProperties();

            ViewBag.FootageTypes = mps;

            return View();
        }
Exemplo n.º 7
0
        public ActionResult Index()
        {
            int randomVideo = Video.RandomVideoIDVideo();

            if (randomVideo > 0)
            {
                var randomVid = new Video(randomVideo);
                ViewBag.NewestVideo = randomVid.ProviderKey;
            }

            LoadUserBandViewBag();

            LoadFilteredVideos(false);

            Contest cndss = Lib.BOL.VideoContest.Contest.GetCurrentContest();
            var cvids = new ContestVideos();
            var vidsInContest = new Videos();
            vidsInContest.AddRange(cvids.Select(cv1 => new Video(cv1.VideoID)));
            vidsInContest.Sort((p1, p2) => p2.PublishDate.CompareTo(p1.PublishDate));
            var sngrcds3 = new SongRecords();
            sngrcds3.AddRange(vidsInContest.Select(v1 => new SongRecord(v1)));

            ViewBag.ContestVideoList = sngrcds3.VideosList();
            ViewBag.CurrentContest = cndss;
            ViewBag.VideoTypes = GetVideoTypes();
            ViewBag.PersonTypes = GetPersonTypes();
            ViewBag.FootageTypes = GetFootageTypes();

            return View();
        }