Ejemplo n.º 1
0
 public static void Populate(this AniDB_Anime_Tag tag, Raw_AniDB_Tag rawTag)
 {
     tag.AnimeID  = rawTag.AnimeID;
     tag.TagID    = rawTag.TagID;
     tag.Approval = 100;
     tag.Weight   = rawTag.Weight;
 }
Ejemplo n.º 2
0
        public static List <Raw_AniDB_Tag> ProcessTags(XmlDocument docAnime, int animeID)
        {
            List <Raw_AniDB_Tag> tags = new List <Raw_AniDB_Tag>();

            XmlNodeList tagItems = docAnime?["anime"]?["tags"]?.GetElementsByTagName("tag");

            if (tagItems == null)
            {
                return(tags);
            }
            foreach (XmlNode node in tagItems)
            {
                try
                {
                    Raw_AniDB_Tag tag = new Raw_AniDB_Tag();
                    tag.ProcessFromHTTPResult(node, animeID);
                    tags.Add(tag);
                }
                catch (Exception ex)
                {
                    logger.Error(ex, $"Error in AniDBHTTPHelper.ProcessTags: {ex}");
                }
            }

            return(tags);
        }
Ejemplo n.º 3
0
 public void Populate(Raw_AniDB_Tag rawTag)
 {
     this.AnimeID  = rawTag.AnimeID;
     this.TagID    = rawTag.TagID;
     this.Approval = 100;
     this.Weight   = rawTag.Weight;
 }
Ejemplo n.º 4
0
 public void Populate(Raw_AniDB_Tag rawTag)
 {
     this.TagID          = rawTag.TagID;
     this.GlobalSpoiler  = rawTag.GlobalSpoiler;
     this.LocalSpoiler   = rawTag.LocalSpoiler;
     this.Spoiler        = rawTag.Spoiler;
     this.TagCount       = rawTag.TagCount;
     this.TagDescription = rawTag.TagDescription;
     this.TagName        = rawTag.TagName;
 }
Ejemplo n.º 5
0
 public static void Populate(this AniDB_Tag tag, Raw_AniDB_Tag rawTag)
 {
     tag.TagID          = rawTag.TagID;
     tag.GlobalSpoiler  = rawTag.GlobalSpoiler;
     tag.LocalSpoiler   = rawTag.LocalSpoiler;
     tag.Spoiler        = 0;
     tag.TagCount       = 0;
     tag.TagDescription = rawTag.TagDescription;
     tag.TagName        = rawTag.TagName;
 }
Ejemplo n.º 6
0
        public static bool Populate(this AniDB_Anime_Tag tag, Raw_AniDB_Tag rawTag)
        {
            if (rawTag == null)
            {
                return(false);
            }
            if (rawTag.AnimeID <= 0 || rawTag.TagID <= 0)
            {
                return(false);
            }
            tag.AnimeID  = rawTag.AnimeID;
            tag.TagID    = rawTag.TagID;
            tag.Approval = 100;
            tag.Weight   = rawTag.Weight;

            return(true);
        }
Ejemplo n.º 7
0
        public static bool Populate(this AniDB_Tag tag, Raw_AniDB_Tag rawTag)
        {
            if (rawTag == null)
            {
                return(false);
            }
            if (rawTag.TagID <= 0 || string.IsNullOrEmpty(rawTag.TagName))
            {
                return(false);
            }
            tag.TagID          = rawTag.TagID;
            tag.GlobalSpoiler  = rawTag.GlobalSpoiler;
            tag.LocalSpoiler   = rawTag.LocalSpoiler;
            tag.Spoiler        = 0;
            tag.TagCount       = 0;
            tag.TagDescription = rawTag.TagDescription ?? string.Empty;
            tag.TagName        = rawTag.TagName;

            return(true);
        }
Ejemplo n.º 8
0
 public void Populate(Raw_AniDB_Tag rawTag)
 {
     this.AnimeID  = rawTag.AnimeID;
     this.TagID    = rawTag.TagID;
     this.Approval = rawTag.Approval;
 }