protected void FormateChannelName(AuthNode plat, VideoBase video) { if (!string.IsNullOrEmpty(plat.FormateName)) { int index = video.Main.Name.LastIndexOf(plat.FormateName); if (index >= 0) { video.ChannelName = video.Main.Name.Substring(0, index); } else { video.ChannelName = video.Main.Name; } } else { video.ChannelName = video.Main.Name; } var v = video as VideoNode; if (v != null) //是点播 { if (!string.IsNullOrEmpty(plat.ReplaceName)) { string[] names = plat.ReplaceName.Split(SplitArray.DHArray, StringSplitOptions.RemoveEmptyEntries); foreach (string n in names) { video.ChannelName = video.ChannelName.Replace(n, ""); } } } }
protected void FormateImage(AuthNode plat, VideoBase video) { if (!string.IsNullOrEmpty(plat.FormateImage)) { video.ResImage = video.BKInfo.CoverPic.Replace("75X100", plat.FormateImage); } else { video.ResImage = video.BKInfo.CoverPic; } }
public Boolean AddOrUpdate(AuthNode item) { var szServices = new DbHelperEfSql <AuthNode>(); if (item.AuthNodeID == Guid.Empty) { item.AuthNodeID = Guid.NewGuid(); return(szServices.Add(item)); } else { return(szServices.Update(item, c => c.AuthNodeID == item.AuthNodeID)); } }
/// <summary> /// 根据平台加载导航实体 /// </summary> /// <returns></returns> private object FormatRecommands(Dictionary <RecommandKey, List <LiveRecommandNode> > dic, LiveRecommandInfo info, AuthNode plat, IEnumerable <ChannelLiveRecomRelInfo> recrels) { var videos = new List <LiveVideoNode>(recrels.Count()); var orderrecrels = recrels.OrderBy(r => r.Rank); foreach (var recrel in orderrecrels) { LiveVideoNode video; if (LiveListCache.Instance.Dictionary.TryGetValue(recrel.ChannelID, out video)) { if (video.PlatForms.Contains(plat)) { videos.Add(video); } } } if (videos.Count <= 0) { return(null); } var key = new RecommandKey(info.Mode, plat.PlatformName, plat.Licence); var node = new LiveRecommandNode() { Language = SimpleLanguageHandler.ProcessLang(info.Name, string.Empty), ID = info.ID, PicLink = info.PicLink, Lists = videos }; dic[key].Add(node); dic[new RecommandKey(plat.PlatformName, plat.Licence, info.ID)] = new List <LiveRecommandNode>() { node }; return(null); }