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)); }