/// <summary> /// XML输出 /// </summary> private void ResponseXml(TreeNode node, XElement xml, TreeleftFilter filter, VideoNodeKey key, bool isEx) { int count, allcount; if (!isEx) { var filters = VideoNodesUtil.CommonCustomFilter(filter); if (filters.Count <= 0) { count = GetChannelCount(node, key); allcount = GetAllChannelCount(node, key) + count; } else { count = GetChannelExCount(node, key, filters, filter); allcount = GetAllChannelExCount(node, key, filters, filter) + count; } } else { var filters = VideoNodesUtil.FormateTagFilter(filter); count = GetChannelExCount(node, key, filters, filter); allcount = GetAllChannelExCount(node, key, filters, filter) + count; } xml.Add(new XElement("treeleft", new XElement("tlid", node.Node.NodeID), new XElement("father_tlid", node.Node.ParentNodeID), new XElement("name", node.Language[filter.lang].Title), new XElement("remark", node.Language[filter.lang].SubTitle), new XElement("subtreeleft_count", node.Childrens.Count), new XElement("subtreeleft_totalcount", node.ALLChildrens), new XElement("subv_count", count), new XElement("subv_totalcount", allcount) )); }
/// <summary> /// 直播分类信息扩展接口 /// </summary> public string LiveTypesEx(LiveFilter filter) { try { var key = new VideoNodeKey(filter.platform, filter.type, filter.auth); var root = new XElement("types"); var filters = VideoNodesUtil.FormateTagFilter(filter); root.Add(from livetype in LiveTypeDicCache.Instance.Items where livetype.Channels.ContainsKey(key) let count = GetChannelCount(livetype, key, filter, filters) where count > 0 select new XElement("type", new XElement("tid", livetype.ID), new XElement("name", livetype.Language[filter.lang].Title), new XElement("count", count), new XElement("image", livetype.PicLink) )); return(root.ToString(SaveOptions.DisableFormatting)); } catch (KeyNotFoundException) { return(NoPlatLive()); } catch (Exception ex) { return(BoxUtils.FormatErrorMsg(ex)); } }
public string ImageNavEx(CoverFilter filter) { try { var res = CoverNavCache.Instance.Items[filter.navmode]; var xml = new XElement("navs"); var key = new VideoNodeKey(filter.platform, 0, filter.auth); var filters = VideoNodesUtil.FormateTagFilter(filter); xml.Add(from re in res let count = GetChannelCount(re, key, filter, filters) where count > 0 select new XElement("nav", new XElement("navid", re.Id), new XElement("name", re.Language[filter.lang].Title), new XElement("count", count), new XElement("image", re.PicLink) )); return(xml.ToString(SaveOptions.DisableFormatting)); } catch (KeyNotFoundException) { return(NoModeNav()); } catch (Exception ex) { return(BoxUtils.FormatErrorMsg(ex)); } }
public string ImageRecommandEx(CoverFilter filter) { try { var pars = VideoParsUtils.FormateSearchVideoPars(filter); var filters = VideoNodesUtil.FormateTagFilter(filter); var rel = CoverNavCache.Instance.Dictionary[filter.navid]; return(CreatePageList(rel, filter, pars, filters, true)); } catch (KeyNotFoundException) { return(NoPlatformNav()); } catch (Exception ex) { return(BoxUtils.FormatErrorMsg(ex)); } }
public string LiveRecommandNavEx(LiveNavFilter filter) { try { var recommands = LiveRecommandCache.Instance.Items[new RecommandKey(filter.mode, filter.platform, filter.auth)]; var root = new XElement("navs"); IEnumerable <XElement> query = null; var filters = VideoNodesUtil.FormateTagFilter(filter); query = from recommand in recommands let vs = FilterList(recommand, filters, filter) where vs.Count > 0 select CreateNavEx(recommand, vs.Count, filter); root.Add(query); return(root.ToString(SaveOptions.DisableFormatting)); } catch (KeyNotFoundException) { return(NoModeNav()); } catch (Exception ex) { return(BoxUtils.FormatErrorMsg(ex)); } }
public string LiveRecommandListEx(LiveNavFilter filter) { try { var recommands = LiveRecommandCache.Instance.Items[new RecommandKey(filter.platform, filter.auth, filter.navid)]; if (recommands.Count <= 0) { return(NoModeNav()); } var pars = VideoParsUtils.FormateSearchVideoPars(filter); var filters = VideoNodesUtil.FormateTagFilter(filter); var videos = FilterList(recommands[0], filters, filter); return(CreatePageList(recommands[0], videos, filter, pars, true)); } catch (KeyNotFoundException) { return(NoPlatformNav()); } catch (Exception ex) { return(BoxUtils.FormatErrorMsg(ex)); } }