コード例 #1
0
        public VideoCategoryModel ByCategory(string token, int lang, string categ, int ini, int max)
        {
            string userId = "";

            if (token != "" && token != null)
            {
                string machine = HttpContext.Features.Get <IHttpConnectionFeature>()?.RemoteIpAddress.ToString();
                userId = SessionCode.ValidateSessionCode(token, machine);
            }

            lang = LibVisLib.Verify.ValidLanguage(lang);
            RacMsg msgs = RacMsg.cache.GetMessage((RacMsg.Language)lang);

            VideoCategoryModel m = new VideoCategoryModel();

            LibVisLib.Category c = LibVisLib.Category.LoadCategory(categ);
            if (c != null)
            {
                m.Title       = msgs.Get(c.nameMsg);
                m.Description = msgs.Get(c.descriptionMsg);
                m.Ini         = ini;
                m.Total       = Video.GetTotalLastVideos(lang, categ);
                m.Videos      = ControllerBase.LatestVideosByCategory(lang, categ, ini, max);
            }

            return(m);
        }
コード例 #2
0
 public NewsCategory(RacLib.RacMsg msgs, LibVisLib.Category c)
 {
     Label    = c.label;
     Category = msgs.Get(c.nameMsg);
 }