Пример #1
0
        public static void AllocateTags(List <Artist> artists)
        {
            if (artists.Count == 0 || artists[0].tags != null)
            {
                return;
            }
            for (int i = 0; i < artists.Count; i++)
            {
                var dict = new Dictionary <string, int>();
                foreach (var article in artists[i].articles)
                {
                    var md = HitomiLegalize.GetMetadataFromMagic(article.ToString()).Value;
                    if (md.Tags == null)
                    {
                        continue;
                    }

                    foreach (var tag in md.Tags)
                    {
                        //if (!dict.ContainsKey(tag))
                        //    dict.Add(tag, 0);
                        //dict[tag]++;
                    }
                }
                artists[i].tags = dict;
            }
        }
Пример #2
0
        public static void AllocateTypes(List <Artist> artists)
        {
            if (artists.Count == 0 || artists[0].types != null)
            {
                return;
            }
            for (int i = 0; i < artists.Count; i++)
            {
                var dict = new Dictionary <string, int>();
                foreach (var article in artists[i].articles)
                {
                    var md = HitomiLegalize.GetMetadataFromMagic(article.ToString()).Value;

                    var type = md.Type;
                    //if (md.Language == null) type = "n/a";

                    //if (!dict.ContainsKey(type))
                    //    dict.Add(type, 0);
                    //dict[type]++;
                }
                artists[i].types = dict;
            }
        }