コード例 #1
0
ファイル: AniDBHTTPHelper.cs プロジェクト: Bareus/ShokoServer
        public static List <Raw_AniDB_Episode> ProcessEpisodes(XmlDocument docAnime, int animeID)
        {
            List <Raw_AniDB_Episode> eps = new List <Raw_AniDB_Episode>();

            XmlNodeList episodeItems = docAnime?["anime"]?["episodes"]?.GetElementsByTagName("episode");

            if (episodeItems == null)
            {
                return(eps);
            }
            foreach (XmlNode node in episodeItems)
            {
                try
                {
                    Raw_AniDB_Episode ep = new Raw_AniDB_Episode();
                    if (!ep.ProcessEpisodeSource(node, animeID))
                    {
                        logger.Error($"AniDB Episode raw data had invalid return data:\n        {node}");
                        continue;
                    }
                    eps.Add(ep);
                }
                catch (Exception exc)
                {
                    logger.Error(exc, $"Error in ProcessEpisodes: {exc}");
                }
            }

            return(eps);
        }
コード例 #2
0
        public static List <Raw_AniDB_Episode> ProcessEpisodes(XmlDocument docAnime, int animeID)
        {
            List <Raw_AniDB_Episode> eps = new List <Raw_AniDB_Episode>();

            try
            {
                if (docAnime != null && docAnime["anime"] != null && docAnime["anime"]["episodes"] != null)
                {
                    XmlNodeList episodeItems = docAnime["anime"]["episodes"].GetElementsByTagName("episode");

                    foreach (XmlNode node in episodeItems)
                    {
                        try
                        {
                            Raw_AniDB_Episode ep = new Raw_AniDB_Episode();
                            ep.ProcessEpisodeSource(node, animeID);
                            eps.Add(ep);
                        }
                        catch (Exception ex)
                        {
                            //BaseConfig.MyAnimeLog.Write("Error in ProcessEpisodes: {0}", ex);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                logger.ErrorException("Error in AniDBHTTPHelper.ProcessEpisodes: {0}", ex);
                return(null);
            }

            return(eps);
        }
コード例 #3
0
ファイル: AniDBHTTPHelper.cs プロジェクト: dizzydezz/jmm
		public static List<Raw_AniDB_Episode> ProcessEpisodes(XmlDocument docAnime, int animeID)
		{
			List<Raw_AniDB_Episode> eps = new List<Raw_AniDB_Episode>();

			try
			{
				if (docAnime != null && docAnime["anime"] != null && docAnime["anime"]["episodes"] != null)
				{
					XmlNodeList episodeItems = docAnime["anime"]["episodes"].GetElementsByTagName("episode");

					foreach (XmlNode node in episodeItems)
					{
						try
						{
							Raw_AniDB_Episode ep = new Raw_AniDB_Episode();
							ep.ProcessEpisodeSource(node, animeID);
							eps.Add(ep);
						}
						catch (Exception ex)
						{
							//BaseConfig.MyAnimeLog.Write("Error in ProcessEpisodes: {0}", ex);
						}
					}
				}
			}
			catch (Exception ex)
			{
				logger.ErrorException("Error in AniDBHTTPHelper.ProcessEpisodes: {0}", ex);
				return null;
			}

			return eps;
		}