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

            XmlNodeList titleItems = docAnime?["anime"]?["titles"]?.GetElementsByTagName("title");

            if (titleItems == null)
            {
                return(titles);
            }
            foreach (XmlNode node in titleItems)
            {
                try
                {
                    Raw_AniDB_Anime_Title animeTitle = new Raw_AniDB_Anime_Title();
                    animeTitle.ProcessFromHTTPResult(node, animeID);
                    titles.Add(animeTitle);
                }
                catch (Exception ex)
                {
                    logger.Error(ex, $"Error in AniDBHTTPHelper.ProcessTitles: {animeID} - {ex}");
                }
            }

            return(titles);
        }
コード例 #2
0
ファイル: AniDB_Anime_Title.cs プロジェクト: dizzydezz/jmm
		public void Populate(Raw_AniDB_Anime_Title rawTitle)
		{
			this.AnimeID = rawTitle.AnimeID;
			this.Language = rawTitle.Language;
			this.Title = rawTitle.Title;
			this.TitleType = rawTitle.TitleType;
		}
コード例 #3
0
        public static List <Raw_AniDB_Anime_Title> ProcessTitles(XmlDocument docAnime, int animeID)
        {
            List <Raw_AniDB_Anime_Title> titles = new List <Raw_AniDB_Anime_Title>();

            try
            {
                if (docAnime["anime"]["titles"] != null)
                {
                    XmlNodeList titleItems = docAnime["anime"]["titles"].GetElementsByTagName("title");
                    if (titleItems != null)
                    {
                        foreach (XmlNode node in titleItems)
                        {
                            try
                            {
                                Raw_AniDB_Anime_Title animeTitle = new Raw_AniDB_Anime_Title();
                                animeTitle.ProcessFromHTTPResult(node, animeID);
                                titles.Add(animeTitle);
                            }
                            catch (Exception ex)
                            {
                                //BaseConfig.MyAnimeLog.Write("Error in GetEpisodes: {0}", ex);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                string msg = string.Format("Error in AniDBHTTPHelper.ProcessTitles: {0} - {1}", animeID, ex.ToString());
                logger.ErrorException(msg, ex);
                return(null);
            }

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

			try
			{
				if (docAnime["anime"]["titles"] != null)
				{
					XmlNodeList titleItems = docAnime["anime"]["titles"].GetElementsByTagName("title");
					if (titleItems != null)
					{
						foreach (XmlNode node in titleItems)
						{
							try
							{
								Raw_AniDB_Anime_Title animeTitle = new Raw_AniDB_Anime_Title();
								animeTitle.ProcessFromHTTPResult(node, animeID);
								titles.Add(animeTitle);
							}
							catch (Exception ex)
							{
								//BaseConfig.MyAnimeLog.Write("Error in GetEpisodes: {0}", ex);
							}
						}
					}
				}
			}
			catch (Exception ex)
			{
				string msg = string.Format("Error in AniDBHTTPHelper.ProcessTitles: {0} - {1}", animeID, ex.ToString());
				logger.ErrorException(msg, ex);
				return null;
			}

			return titles;
		}