コード例 #1
0
 public static void Populate(this AniDB_Anime_Similar similar, Raw_AniDB_SimilarAnime rawSim)
 {
     similar.AnimeID        = rawSim.AnimeID;
     similar.Approval       = rawSim.Approval;
     similar.Total          = rawSim.Total;
     similar.SimilarAnimeID = rawSim.SimilarAnimeID;
 }
コード例 #2
0
 public void Populate(Raw_AniDB_SimilarAnime rawSim)
 {
     this.AnimeID        = rawSim.AnimeID;
     this.Approval       = rawSim.Approval;
     this.Total          = rawSim.Total;
     this.SimilarAnimeID = rawSim.SimilarAnimeID;
 }
コード例 #3
0
        public static List <Raw_AniDB_SimilarAnime> ProcessSimilarAnime(XmlDocument docAnime, int animeID)
        {
            List <Raw_AniDB_SimilarAnime> rels = new List <Raw_AniDB_SimilarAnime>();

            XmlNodeList simItems = docAnime["anime"]?["similaranime"]?.GetElementsByTagName("anime");

            if (simItems == null)
            {
                return(rels);
            }
            foreach (XmlNode node in simItems)
            {
                try
                {
                    Raw_AniDB_SimilarAnime sim = new Raw_AniDB_SimilarAnime();
                    sim.ProcessFromHTTPResult(node, animeID);
                    rels.Add(sim);
                }
                catch (Exception ex)
                {
                    logger.Error(ex, "Error in AniDBHTTPHelper.ProcessSimilarAnime: {0}");
                }
            }

            return(rels);
        }
コード例 #4
0
        public static bool Populate(this AniDB_Anime_Similar similar, Raw_AniDB_SimilarAnime rawSim)
        {
            if (rawSim == null)
            {
                return(false);
            }
            if (rawSim.AnimeID <= 0 || rawSim.Approval < 0 || rawSim.SimilarAnimeID <= 0 || rawSim.Total < 0)
            {
                return(false);
            }
            similar.AnimeID        = rawSim.AnimeID;
            similar.Approval       = rawSim.Approval;
            similar.Total          = rawSim.Total;
            similar.SimilarAnimeID = rawSim.SimilarAnimeID;

            return(true);
        }