예제 #1
0
        public Hashtable GetProgramByEPGID(String _sEPGID)
        {
            BTVGuideData.BTVGuideData btvGuideData;
            Hashtable hSearchResult = new Hashtable();

            if (_sEPGID == null)
            {
                return(null);
            }

            if (_sEPGID.Trim().Length == 0)
            {
                return(null);
            }

            if (LogonBTVServer())
            {
                btvGuideData = new BTVGuideData.BTVGuideData();
                BTVGuideData.PVSPropertyBag pvsSearchResult = btvGuideData.GetFirstEpisodeBySeriesID(sAuthTicket, _sEPGID);

                foreach (BTVGuideData.PVSProperty pvspProp in pvsSearchResult.Properties)
                {
                    hSearchResult.Add(pvspProp.Name, pvspProp.Value);
                }
                LogoffBTVServer();
            }
            return(hSearchResult);
        }
예제 #2
0
        public Hashtable SearchGuide(String _sSearchValue)
        {
            BTVGuideData.BTVGuideData btvGuideData;
            Hashtable hSearchResult = new Hashtable();

            if (_sSearchValue == null)
            {
                return(null);
            }

            if (_sSearchValue.Trim().Length == 0)
            {
                return(null);
            }

            if (LogonBTVServer())
            {
                btvGuideData = new BTVGuideData.BTVGuideData();
                BTVGuideData.PVSPropertyBag[] pvsSearchResult = btvGuideData.GetEpisodesByKeywordWithLimit(sAuthTicket, _sSearchValue, 1);
                foreach (BTVGuideData.PVSPropertyBag pvspbPropBag in pvsSearchResult)
                {
                    foreach (BTVGuideData.PVSProperty pvspProp in pvspbPropBag.Properties)
                    {
                        hSearchResult.Add(pvspProp.Name, pvspProp.Value);
                    }
                }
                LogoffBTVServer();
            }
            return(hSearchResult);
        }
예제 #3
0
        public Hashtable SearchGuideAll(String _sSearchValue)
        {
            BTVGuideData.BTVGuideData btvGuideData;

            Hashtable hSearchResult = new Hashtable();
            Hashtable hWildCards    = new Hashtable();
            Hashtable hSearchMatch;
            int       nCnt         = 0;
            int       nWildCardCnt = 0;
            String    sSearchKey   = "";
            String    sEpisode     = "";

            if (_sSearchValue == null)
            {
                return(null);
            }

            if (_sSearchValue.Trim().Length == 0)
            {
                return(null);
            }

            if (LogonBTVServer())
            {
                btvGuideData = new BTVGuideData.BTVGuideData();
                sSearchKey   = _sSearchValue;
                if (_sSearchValue.Contains("::"))
                {
                    int nStartIdx = _sSearchValue.IndexOf("::");
                    sSearchKey = _sSearchValue.Substring(0, nStartIdx);
                    sEpisode   = _sSearchValue.Substring(nStartIdx + 2, _sSearchValue.Length - (nStartIdx + 2));
                }
                BTVGuideData.PVSPropertyBag[] pvsSearchResult = btvGuideData.GetEpisodesByKeyword(sAuthTicket, sSearchKey.Replace(":", " "));
                foreach (BTVGuideData.PVSPropertyBag pvspbPropBag in pvsSearchResult)
                {
                    hSearchMatch = new Hashtable();
                    foreach (BTVGuideData.PVSProperty pvspProp in pvspbPropBag.Properties)
                    {
                        hSearchMatch.Add(pvspProp.Name, pvspProp.Value);
                    }
                    if (hSearchMatch["SeriesTitle"].ToString().Trim().ToLower().Equals(_sSearchValue.Trim().ToLower()) ||
                        hSearchMatch["DisplayTitle"].ToString().Trim().ToLower().Equals(_sSearchValue.Trim().ToLower()))
                    {
                        if (sEpisode != "")
                        {
                            if (hSearchMatch["EpisodeTitle"].ToString().Contains(sEpisode))
                            {
                                hSearchResult.Add(Convert.ToString(++nCnt), hSearchMatch);
                            }
                        }
                        else
                        {
                            hSearchResult.Add(Convert.ToString(++nCnt), hSearchMatch);
                        }
                    }
                    else
                    {
                        hWildCards.Add(Convert.ToString(++nWildCardCnt), hSearchMatch);
                    }
                }
                for (int i = 1; i <= nWildCardCnt; i++)
                {
                    hSearchResult.Add(Convert.ToString(++nCnt), hWildCards[Convert.ToString(i)]);
                }
                LogoffBTVServer();
            }
            return(hSearchResult);
        }