示例#1
0
        public static List <VideoData> ParseSearch(string jsonSource)
        {
            object json;

            if (!VideoDataParser.ParseJSON(jsonSource, out json))
            {
                Service.Get <StaRTSLogger>().Error("Failed to parse Search JSON");
                return(null);
            }
            Dictionary <string, List <VideoData> > dictionary = new Dictionary <string, List <VideoData> >();

            if (!VideoDataParser.ParseFeed(json, ref dictionary))
            {
                Service.Get <StaRTSLogger>().Error("Failed to parse Search");
                return(null);
            }
            using (Dictionary <string, List <VideoData> > .ValueCollection.Enumerator enumerator = dictionary.Values.GetEnumerator())
            {
                if (enumerator.MoveNext())
                {
                    return(enumerator.Current);
                }
            }
            return(null);
        }
示例#2
0
        public static Dictionary <string, List <VideoData> > ParseUserFeed(string jsonSource)
        {
            if (jsonSource == null)
            {
                return(null);
            }
            object json;

            if (!VideoDataParser.ParseJSON(jsonSource, out json))
            {
                Service.Get <StaRTSLogger>().Error("Failed to parse UserFeed JSON");
                return(null);
            }
            Dictionary <string, List <VideoData> > result = new Dictionary <string, List <VideoData> >();

            if (!VideoDataParser.ParseFeed(json, ref result))
            {
                Service.Get <StaRTSLogger>().Error("Failed to parse UserFeed");
                return(null);
            }
            return(result);
        }