Exemple #1
0
 public string NavLists(NavFilter filter)
 {
     try
     {
         var key     = new VideoNodeKey(filter.platform, 0, filter.auth);
         var pars    = VideoParsUtils.FormateSearchVideoPars(filter);
         var filters = VideoNodesUtil.FormateVodFilter(filter);
         var rel     = RecommandCache.Instance.Dictionary[filter.navid];
         var query   = rel.Channels[key].Where(v =>
         {
             bool result = true;
             var video   = ListCache.Instance.Dictionary[v];
             foreach (var f in filters)
             {
                 result = result && f(video, filter);
             }
             return(result);
         });
         return(CreatePageList(rel, query, filter, pars, false));
     }
     catch (KeyNotFoundException)
     {
         return(NoPlatformNav());
     }
     catch (Exception ex)
     {
         return(BoxUtils.FormatErrorMsg(ex));
     }
 }
Exemple #2
0
 public string LiveRecommandList(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.CommonCustomFilter(filter);
         if (filters.Count <= 0)
         {
             return(CreatePageList(recommands[0], recommands[0].Lists, filter, pars, false));
         }
         else
         {
             var videos = FilterList(recommands[0], filters, filter);
             return(CreatePageList(recommands[0], videos, filter, pars, false));
         }
     }
     catch (KeyNotFoundException)
     {
         return(NoPlatformNav());
     }
     catch (Exception ex)
     {
         return(BoxUtils.FormatErrorMsg(ex));
     }
 }
Exemple #3
0
 public string ImageRecommand(CoverFilter filter)
 {
     try
     {
         var pars    = VideoParsUtils.FormateSearchVideoPars(filter);
         var filters = VideoNodesUtil.CommonCustomFilter(filter);
         var rel     = CoverNavCache.Instance.Dictionary[filter.navid];
         return(CreatePageList(rel, filter, pars, filters, false));
     }
     catch (KeyNotFoundException)
     {
         return(NoPlatformNav());
     }
     catch (Exception ex)
     {
         return(BoxUtils.FormatErrorMsg(ex));
     }
 }
Exemple #4
0
 public string RelevanceEx(RelevanceFilter filter)
 {
     try
     {
         var vids = filter.vids.FormatStrToArray(SplitArray.LineArray);
         int vid  = 0;
         if (int.TryParse(vids[0], out vid))
         {
             var video = ListCache.Instance.Dictionary[vid];
             return(CreateSmarkPageList(LuceneNetUtil.RelevanceSearchEx(filter, SegmentKeyWord(video), filter.c + 1), filter, VideoParsUtils.FormateSearchVideoPars(filter), true));
         }
         return(NoPlatForm());
     }
     catch (KeyNotFoundException)
     {
         return(NoPlatForm());
     }
     catch (Exception ex)
     {
         return(BoxUtils.FormatErrorMsg(ex));
     }
 }
Exemple #5
0
 /// <summary>
 /// 频道名拼音扩展搜索
 /// </summary>
 public string VideoSearchCHEx(ListFilter filter)
 {
     try
     {
         return(CreateSmarkPageList(LuceneNetUtil.SearchEx(filter, EpgIndexNode.CnNameField, EpgIndexNode.NameOccurs, Searcher.SegmentChWord(filter.k), false), filter, VideoParsUtils.FormateSearchVideoPars(filter), true));
     }
     catch (KeyNotFoundException)
     {
         return(NoPlatForm());
     }
     catch (Exception ex)
     {
         return(BoxUtils.FormatErrorMsg(ex));
     }
 }