public ActionResult Par() { ViewBag.PageTitle = ConfigurationManager.AppSettings["PageTitle"]; ViewBag.UserToken = Session["usertoken"]; ViewBag.UserCode = Session["usercode"]; ViewBag.ResourceUrl = JOVEConfig.PreviewAddress; ViewBag.RootPath = ConfigurationManager.AppSettings["RootPath"]; ViewBag.PreviewPath = JOVEConfig.CMPriviewAddress; ViewBag.TaskMonitorWebAddress = JOVEConfig.TaskMonitorWebAddress; ViewBag.FolderPath = Session["folderPath"]; ViewBag.SiteCode = Session["siteCode"]; if (!string.IsNullOrEmpty(ViewBag.UserToken)) { ViewBag.SocketServer = JOVEConfig.GetSocketServer(ViewBag.UserToken, ViewBag.SiteCode); ViewBag.InstalledFontCollection = JOVEConfig.GetInstalledFontCollection(ViewBag.UserToken, ViewBag.SiteCode); ViewBag.GetET_LANGUAGE = JOVEConfig.GetET_LANGUAGE(ViewBag.UserToken, ViewBag.SiteCode); ViewBag.transCodeTemplate = JOVEConfig.GettransCodeTemplate(ViewBag.UserToken, ViewBag.SiteCode); ViewBag.preSNSPublishPath = JOVEConfig.GetPreSNSPublishPath(ViewBag.UserToken); ViewBag.snsTransCodeType = JOVEConfig.GetSnsTransCodeType(ViewBag.UserToken); } if (string.IsNullOrEmpty(ViewBag.SocketServer)) { ViewBag.SocketServer = "ws://172.16.134.40:3130"; } return(View()); }
public ActionResult RenderPEF(RenderPEFRequest request, string usertoken, string siteCode = "") { ResponseMessage <RenderPefResponse> r = new ResponseMessage <RenderPefResponse>(); request.json.videostandard = JOVEConfig.GetHivevideoStandard(usertoken, siteCode); Logger.Trace("获取素材信息:usertoken={0},title={1},requst={2}\n", usertoken, request.title, JsonHelper.ToJson(request.json)); r = AppContext.Current.FolderService.RenderPEF(usertoken, request.title, request.json); Logger.Trace("执行结果:code:{0},msg:{1}\n", r.Code, r.Msg); return(Json(r, JsonRequestBehavior.AllowGet)); }
public ActionResult SaveTimeLine(RenderPEFRequest requst, string usertoken, string contentid, string siteCode = "") { string lastPefPath = ""; string path = ""; ResponseMessage <SaveClipResponse> r = new ResponseMessage <SaveClipResponse>(); requst.json.videostandard = JOVEConfig.GetHivevideoStandard(usertoken, siteCode); if (contentid == "") { contentid = Guid.NewGuid().ToString("N").ToLower(); } else { var info = AppContext.Current.FolderService.GetClipInfo(usertoken, contentid, "64", "http"); if (info.Code == "0") { lastPefPath = info.Ext.entity.item.filepath; Logger.Trace("pef:{0}", lastPefPath); var bz = ConfigurationManager.AppSettings["z"]; Logger.Trace("z:{0}", bz); var index = lastPefPath.IndexOf("bucket-z") + "bucket-z/".Length; Logger.Trace("index:{0}", index); path = bz + lastPefPath.Substring(index); Logger.Trace("pefpath:{0}", path); } } Logger.Trace("获取素材信息:usertoken={0},path={1},title={2},contentid={3},requst={4}\n", usertoken, requst.folderPath, requst.title, contentid, JsonHelper.ToJson(requst)); r = AppContext.Current.FolderService.SaveTimeLine(usertoken, requst.folderPath, requst.title, contentid, requst.json, siteCode); Logger.Trace("执行结果:code:{0},msg:{1}\n", r.Code, r.Msg); try { if (r.Code == "0" && !string.IsNullOrEmpty(path) && System.IO.File.Exists(path)) { Logger.Trace("执行删除"); System.IO.File.Delete(path); if (!System.IO.File.Exists(path)) { Logger.Trace("delete {0} succuss", path); } else { Logger.Trace("delete {0} failed", path); } } } catch (Exception e) { Logger.Trace("delete failed! path:{0} {1}", path, e.Message); } return(Json(r, JsonRequestBehavior.AllowGet)); }