public static List <Raw_AniDB_Character> ProcessCharacters(XmlDocument docAnime, int animeID)
        {
            List <Raw_AniDB_Character> chars = new List <Raw_AniDB_Character>();

            XmlNodeList charItems = docAnime?["anime"]?["characters"]?.GetElementsByTagName("character");

            if (charItems == null)
            {
                return(chars);
            }
            foreach (XmlNode node in charItems)
            {
                try
                {
                    Raw_AniDB_Character chr = new Raw_AniDB_Character();
                    chr.ProcessFromHTTPResult(node, animeID);
                    chars.Add(chr);
                }
                catch (Exception ex)
                {
                    logger.Error(ex, $"Error in AniDBHTTPHelper.ProcessCharacters: {ex}");
                }
            }

            return(chars);
        }
Exemple #2
0
        public static List <Raw_AniDB_Character> ProcessCharacters(XmlDocument docAnime, int animeID)
        {
            List <Raw_AniDB_Character> chars = new List <Raw_AniDB_Character>();

            try
            {
                if (docAnime["anime"]["characters"] != null)
                {
                    XmlNodeList charItems = docAnime["anime"]["characters"].GetElementsByTagName("character");
                    if (charItems != null)
                    {
                        foreach (XmlNode node in charItems)
                        {
                            try
                            {
                                Raw_AniDB_Character chr = new Raw_AniDB_Character();
                                chr.ProcessFromHTTPResult(node, animeID);
                                chars.Add(chr);
                            }
                            catch (Exception ex)
                            {
                                //BaseConfig.MyAnimeLog.Write("Error in GetEpisodes: {0}", ex);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                logger.ErrorException("Error in AniDBHTTPHelper.ProcessCharacters: {0}", ex);
                return(null);
            }

            return(chars);
        }
		public void Populate(Raw_AniDB_Character rawChar)
		{
			this.CharID = rawChar.CharID;
			this.AnimeID = rawChar.AnimeID;
			this.CharType = rawChar.CharType;
			this.EpisodeListRaw = rawChar.EpisodeListRaw;
		}
Exemple #4
0
		private void Populate(Raw_AniDB_Character rawChar)
		{
			this.CharID = rawChar.CharID;
			this.CharDescription = rawChar.CharDescription;
			this.CharKanjiName = rawChar.CharKanjiName;
			this.CharName = rawChar.CharName;
			this.PicName = rawChar.PicName;
			this.CreatorListRaw = rawChar.CreatorListRaw;
			
		}
Exemple #5
0
		public void PopulateFromUDP(Raw_AniDB_Character rawChar)
		{
			if (this.CharID == 0) // a new object
			{
				Populate(rawChar);
			}
			else
			{
				// only update the fields that com from UDP API
				this.CharKanjiName = rawChar.CharKanjiName;
				this.CharName = rawChar.CharName;
				//this.CreatorListRaw = rawChar.CreatorListRaw;
			}
		}
Exemple #6
0
		public void PopulateFromHTTP(Raw_AniDB_Character rawChar)
		{
			if (this.CharID == 0) // a new object
			{
				Populate(rawChar);
			}
			else
			{
				// only update the fields that come from HTTP API
				this.CharDescription = rawChar.CharDescription;
				this.CharName = rawChar.CharName;
				this.CreatorListRaw = rawChar.CreatorListRaw;
				this.PicName = rawChar.PicName;
			}
		}
Exemple #7
0
		public static List<Raw_AniDB_Character> ProcessCharacters(XmlDocument docAnime, int animeID)
		{
			List<Raw_AniDB_Character> chars = new List<Raw_AniDB_Character>();

			try
			{
				if (docAnime["anime"]["characters"] != null)
				{
					XmlNodeList charItems = docAnime["anime"]["characters"].GetElementsByTagName("character");
					if (charItems != null)
					{
						foreach (XmlNode node in charItems)
						{
							try
							{
								Raw_AniDB_Character chr = new Raw_AniDB_Character();
								chr.ProcessFromHTTPResult(node, animeID);
								chars.Add(chr);
							}
							catch (Exception ex)
							{
								//BaseConfig.MyAnimeLog.Write("Error in GetEpisodes: {0}", ex);
							}
						}
					}
				}
			}
			catch (Exception ex)
			{
				logger.ErrorException("Error in AniDBHTTPHelper.ProcessCharacters: {0}", ex);
				return null;
			}

			return chars;
		}