Exemple #1
0
        public void UpdateArtistsIncremetns(bool specifictag = false, int tag = -1)
        {
            samples.Clear();

            Dictionary <string, Dictionary <int, int> > artist_list = new Dictionary <string, Dictionary <int, int> >();

            foreach (var metadata in HitomiIndex.Instance.metadata_collection)
            {
                if (metadata.Artists != null && (!specifictag || (metadata.Tags != null && metadata.Tags.Contains(tag))))
                {
                    foreach (var artist in metadata.Artists.Where(artist => !artist_list.ContainsKey(HitomiIndex.Instance.index.Artists[artist])))
                    {
                        artist_list.Add(HitomiIndex.Instance.index.Artists[artist], new Dictionary <int, int>());
                    }
                }
            }

            foreach (var data in datas)
            {
                foreach (var metadata in data.Value)
                {
                    if (metadata.Artists != null && (!specifictag || (metadata.Tags != null && metadata.Tags.Contains(tag))))
                    {
                        foreach (var _artist in metadata.Artists)
                        {
                            var artist = HitomiIndex.Instance.index.Artists[_artist];
                            if (artist_list[artist].ContainsKey(data.Key))
                            {
                                artist_list[artist][data.Key] += 1;
                            }
                            else
                            {
                                artist_list[artist].Add(data.Key, 1);
                            }
                        }
                    }
                }
            }

            foreach (var artist in artist_list)
            {
                HitomiAnalysisTrendElement e = new HitomiAnalysisTrendElement();
                e.name   = artist.Key;
                e.points = new List <Point>();
                int nujuk = 0;

                foreach (var pair in artist.Value)
                {
                    nujuk += pair.Value;
                    e.points.Add(new Point(pair.Key, nujuk));
                }
                samples.Add(e);
            }

            samples.Sort((a, b) => b.points.Last().Y.CompareTo(a.points.Last().Y));
            if (samples.Count > 10)
            {
                samples.RemoveRange(10, samples.Count - 10);
            }
        }
        public void UpdateCharactersKoreanIncremetns(bool specifictag = false, string tag = "")
        {
            samples.Clear();

            Dictionary <string, Dictionary <int, int> > character_list = new Dictionary <string, Dictionary <int, int> >();

            foreach (var metadata in HitomiData.Instance.metadata_collection)
            {
                if (metadata.Language == Settings.Instance.Hitomi.Language && metadata.Characters != null && (!specifictag || (metadata.Tags != null && metadata.Tags.Contains(tag))))
                {
                    foreach (var character in metadata.Characters.Where(character => !character_list.ContainsKey(character)))
                    {
                        character_list.Add(character, new Dictionary <int, int>());
                    }
                }
            }

            foreach (var data in datas)
            {
                foreach (var metadata in data.Value)
                {
                    if (metadata.Language == Settings.Instance.Hitomi.Language && metadata.Characters != null && (!specifictag || (metadata.Tags != null && metadata.Tags.Contains(tag))))
                    {
                        foreach (var character in metadata.Characters)
                        {
                            if (character_list[character].ContainsKey(data.Key))
                            {
                                character_list[character][data.Key] += 1;
                            }
                            else
                            {
                                character_list[character].Add(data.Key, 1);
                            }
                        }
                    }
                }
            }

            foreach (var character in character_list)
            {
                HitomiAnalysisTrendElement e = new HitomiAnalysisTrendElement();
                e.name   = character.Key;
                e.points = new List <Point>();
                int nujuk = 0;

                foreach (var pair in character.Value)
                {
                    nujuk += pair.Value;
                    e.points.Add(new Point(pair.Key, nujuk));
                }
                samples.Add(e);
            }

            samples.Sort((a, b) => b.points.Last().Y.CompareTo(a.points.Last().Y));
            if (samples.Count > 10)
            {
                samples.RemoveRange(10, samples.Count - 10);
            }
        }
        public void UpdateTagKoreanIncrements()
        {
            samples.Clear();

            Dictionary <string, Dictionary <int, int> > tag_list = new Dictionary <string, Dictionary <int, int> >();

            foreach (var metadata in HitomiData.Instance.metadata_collection)
            {
                if (metadata.Language == Settings.Instance.Hitomi.Language && metadata.Tags != null)
                {
                    foreach (var tag in metadata.Tags)
                    {
                        if (!tag_list.ContainsKey(tag))
                        {
                            tag_list.Add(tag, new Dictionary <int, int>());
                        }
                    }
                }
            }

            foreach (var data in datas)
            {
                foreach (var metadata in data.Value)
                {
                    if (metadata.Language == Settings.Instance.Hitomi.Language && metadata.Tags != null)
                    {
                        foreach (var tag in metadata.Tags)
                        {
                            if (tag_list[tag].ContainsKey(data.Key))
                            {
                                tag_list[tag][data.Key] += 1;
                            }
                            else
                            {
                                tag_list[tag].Add(data.Key, 1);
                            }
                        }
                    }
                }
            }

            foreach (var tag in tag_list)
            {
                HitomiAnalysisTrendElement e = new HitomiAnalysisTrendElement();
                e.name   = tag.Key;
                e.points = new List <Point>();
                int nujuk = 0;

                foreach (var pair in tag.Value)
                {
                    nujuk += pair.Value;
                    e.points.Add(new Point(pair.Key, nujuk));
                }
                samples.Add(e);
            }

            samples.Sort((a, b) => b.points.Last().Y.CompareTo(a.points.Last().Y));
            samples.RemoveRange(10, samples.Count - 10);
        }
Exemple #4
0
        public void UpdateTagIncrements()
        {
            samples.Clear();

            Dictionary <string, Dictionary <int, int> > tag_list = new Dictionary <string, Dictionary <int, int> >();

            foreach (var metadata in HitomiIndex.Instance.metadata_collection)
            {
                if (metadata.Tags != null)
                {
                    foreach (var tag in metadata.Tags.Where(tag => !tag_list.ContainsKey(HitomiIndex.Instance.index.Tags[tag])))
                    {
                        tag_list.Add(HitomiIndex.Instance.index.Tags[tag], new Dictionary <int, int>());
                    }
                }
            }

            foreach (var data in datas)
            {
                foreach (var metadata in data.Value)
                {
                    if (metadata.Tags != null)
                    {
                        foreach (var _tag in metadata.Tags)
                        {
                            var tag = HitomiIndex.Instance.index.Tags[_tag];
                            if (tag_list[tag].ContainsKey(data.Key))
                            {
                                tag_list[tag][data.Key] += 1;
                            }
                            else
                            {
                                tag_list[tag].Add(data.Key, 1);
                            }
                        }
                    }
                }
            }

            foreach (var tag in tag_list)
            {
                HitomiAnalysisTrendElement e = new HitomiAnalysisTrendElement();
                e.name   = tag.Key;
                e.points = new List <Point>();
                int nujuk = 0;

                foreach (var pair in tag.Value)
                {
                    nujuk += pair.Value;
                    e.points.Add(new Point(pair.Key, nujuk));
                }
                samples.Add(e);
            }

            samples.Sort((a, b) => b.points.Last().Y.CompareTo(a.points.Last().Y));
            samples.RemoveRange(max_cnt, samples.Count - max_cnt);
        }
Exemple #5
0
        public void UpdateGalleryVariation()
        {
            samples.Clear();
            HitomiAnalysisTrendElement e = new HitomiAnalysisTrendElement();

            e.name   = "업로드 변동";
            e.points = new List <Point>();

            foreach (var data in datas)
            {
                e.points.Add(new Point(data.Key, data.Value.Count));
            }

            samples.Add(e);
        }
Exemple #6
0
        public void UpdataGalleryIncrements()
        {
            samples.Clear();
            HitomiAnalysisTrendElement e = new HitomiAnalysisTrendElement();

            e.name   = "업로드 수";
            e.points = new List <Point>();

            int nujuk = 0;

            foreach (var data in datas)
            {
                nujuk += data.Value.Count;
                e.points.Add(new Point(data.Key, nujuk));
            }

            samples.Add(e);
        }
Exemple #7
0
        public void UpdateCharactersKoreanVariation()
        {
            samples.Clear();

            Dictionary <string, Dictionary <int, int> > character_list = new Dictionary <string, Dictionary <int, int> >();

            foreach (var metadata in HitomiIndex.Instance.metadata_collection)
            {
                var lang = "n/a";
                if (metadata.Language >= 0)
                {
                    lang = HitomiIndex.Instance.index.Languages[metadata.Language];
                }
                if (lang == Settings.Instance.Hitomi.Language && metadata.Characters != null)
                {
                    foreach (var series in metadata.Characters.Where(series => !character_list.ContainsKey(HitomiIndex.Instance.index.Characters[series])))
                    {
                        character_list.Add(HitomiIndex.Instance.index.Characters[series], new Dictionary <int, int>());
                    }
                }
            }

            foreach (var data in datas)
            {
                if (data.Key > 1125000)
                {
                    foreach (var metadata in data.Value)
                    {
                        var lang = "n/a";
                        if (metadata.Language >= 0)
                        {
                            lang = HitomiIndex.Instance.index.Languages[metadata.Language];
                        }
                        if (lang == Settings.Instance.Hitomi.Language && metadata.Characters != null)
                        {
                            foreach (var _series in metadata.Characters)
                            {
                                var series = HitomiIndex.Instance.index.Characters[_series];
                                if (character_list[series].ContainsKey(data.Key))
                                {
                                    character_list[series][data.Key] += 1;
                                }
                                else
                                {
                                    character_list[series].Add(data.Key, 1);
                                }
                            }
                        }
                    }
                }
            }

            foreach (var series in character_list)
            {
                HitomiAnalysisTrendElement e = new HitomiAnalysisTrendElement();
                e.name   = series.Key;
                e.points = new List <Point>();

                foreach (var pair in series.Value)
                {
                    e.points.Add(new Point(pair.Key, pair.Value));
                }
                samples.Add(e);
            }

            samples.Sort((a, b) => {
                int bb = 0;
                if (b.points.Count >= 1)
                {
                    bb = b.points.Last().Y;
                }
                if (b.points.Count > 1)
                {
                    for (int i = 0; i < b.points.Count - 2 && i < 5; i++)
                    {
                        bb += b.points[b.points.Count - i - 2].Y;
                    }
                }
                int aa = 0;
                if (a.points.Count >= 1)
                {
                    aa = a.points.Last().Y;
                }
                if (a.points.Count > 1)
                {
                    for (int i = 0; i < a.points.Count - 2 && i < 5; i++)
                    {
                        aa += a.points[a.points.Count - i - 2].Y;
                    }
                }

                return(bb.CompareTo(aa));
            });
            samples.RemoveRange(20, samples.Count - 20);
        }
Exemple #8
0
        public void UpdateSeriesKoreanIncremetns(bool specifictag = false, int tag = -1)
        {
            samples.Clear();

            Dictionary <string, Dictionary <int, int> > series_list = new Dictionary <string, Dictionary <int, int> >();

            foreach (var metadata in HitomiIndex.Instance.metadata_collection)
            {
                var lang = "n/a";
                if (metadata.Language >= 0)
                {
                    lang = HitomiIndex.Instance.index.Languages[metadata.Language];
                }
                if (lang == Settings.Instance.Hitomi.Language && metadata.Parodies != null && (!specifictag || (metadata.Tags != null && metadata.Tags.Contains(tag))))
                {
                    foreach (var series in metadata.Parodies.Where(series => !series_list.ContainsKey(HitomiIndex.Instance.index.Series[series])))
                    {
                        series_list.Add(HitomiIndex.Instance.index.Series[series], new Dictionary <int, int>());
                    }
                }
            }

            foreach (var data in datas)
            {
                foreach (var metadata in data.Value)
                {
                    var lang = "n/a";
                    if (metadata.Language >= 0)
                    {
                        lang = HitomiIndex.Instance.index.Languages[metadata.Language];
                    }
                    if (lang == Settings.Instance.Hitomi.Language && metadata.Parodies != null && (!specifictag || (metadata.Tags != null && metadata.Tags.Contains(tag))))
                    {
                        foreach (var _series in metadata.Parodies)
                        {
                            var series = HitomiIndex.Instance.index.Series[_series];
                            if (series_list[series].ContainsKey(data.Key))
                            {
                                series_list[series][data.Key] += 1;
                            }
                            else
                            {
                                series_list[series].Add(data.Key, 1);
                            }
                        }
                    }
                }
            }

            foreach (var series in series_list)
            {
                HitomiAnalysisTrendElement e = new HitomiAnalysisTrendElement();
                e.name   = series.Key;
                e.points = new List <Point>();
                int nujuk = 0;

                foreach (var pair in series.Value)
                {
                    nujuk += pair.Value;
                    e.points.Add(new Point(pair.Key, nujuk));
                }
                samples.Add(e);
            }

            samples.Sort((a, b) => b.points.Last().Y.CompareTo(a.points.Last().Y));
            if (samples.Count > 10)
            {
                samples.RemoveRange(10, samples.Count - 10);
            }
        }
Exemple #9
0
        public void UpdateTagKoreanVariation()
        {
            samples.Clear();

            Dictionary <string, Dictionary <int, int> > tag_list = new Dictionary <string, Dictionary <int, int> >();

            foreach (var metadata in HitomiIndex.Instance.metadata_collection)
            {
                var lang = "n/a";
                if (metadata.Language >= 0)
                {
                    lang = HitomiIndex.Instance.index.Languages[metadata.Language];
                }
                if (lang == Settings.Instance.Hitomi.Language && metadata.Tags != null)
                {
                    foreach (var tag in metadata.Tags)
                    {
                        if (!tag_list.ContainsKey(HitomiIndex.Instance.index.Tags[tag]))
                        {
                            tag_list.Add(HitomiIndex.Instance.index.Tags[tag], new Dictionary <int, int>());
                        }
                    }
                }
            }

            foreach (var data in datas)
            {
                if (data.Key > 1125000)
                {
                    foreach (var metadata in data.Value)
                    {
                        var lang = "n/a";
                        if (metadata.Language >= 0)
                        {
                            lang = HitomiIndex.Instance.index.Languages[metadata.Language];
                        }
                        if (lang == Settings.Instance.Hitomi.Language && metadata.Tags != null)
                        {
                            foreach (var _tag in metadata.Tags)
                            {
                                var tag = HitomiIndex.Instance.index.Tags[_tag];
                                if (tag_list[tag].ContainsKey(data.Key))
                                {
                                    tag_list[tag][data.Key] += 1;
                                }
                                else
                                {
                                    tag_list[tag].Add(data.Key, 1);
                                }
                            }
                        }
                    }
                }
            }

            foreach (var tag in tag_list)
            {
                HitomiAnalysisTrendElement e = new HitomiAnalysisTrendElement();
                e.name   = tag.Key;
                e.points = new List <Point>();

                foreach (var pair in tag.Value)
                {
                    e.points.Add(new Point(pair.Key, pair.Value));
                }
                samples.Add(e);
            }

            samples.Sort((a, b) => {
                int bb = 0;
                if (b.points.Count >= 1)
                {
                    bb = b.points.Last().Y;
                }
                if (b.points.Count > 1)
                {
                    for (int i = 0; i < b.points.Count - 2 && i < 5; i++)
                    {
                        bb += b.points[b.points.Count - i - 2].Y;
                    }
                }
                int aa = 0;
                if (a.points.Count >= 1)
                {
                    aa = a.points.Last().Y;
                }
                if (a.points.Count > 1)
                {
                    for (int i = 0; i < a.points.Count - 2 && i < 5; i++)
                    {
                        aa += a.points[a.points.Count - i - 2].Y;
                    }
                }

                //return b.points.Last().Y.CompareTo(a.points.Last().Y);
                return(bb.CompareTo(aa));
            });
            samples.RemoveRange(20, samples.Count - 20);
        }
Exemple #10
0
        public void UpdateGroupsKoreanVariation()
        {
            samples.Clear();

            Dictionary <string, Dictionary <int, int> > group_list = new Dictionary <string, Dictionary <int, int> >();

            foreach (var metadata in HitomiIndex.Instance.metadata_collection)
            {
                var lang = "n/a";
                if (metadata.Language >= 0)
                {
                    lang = HitomiIndex.Instance.index.Languages[metadata.Language];
                }
                if (lang == Settings.Instance.Hitomi.Language && metadata.Groups != null)
                {
                    foreach (var group in metadata.Groups)
                    {
                        if (!group_list.ContainsKey(HitomiIndex.Instance.index.Groups[group]))
                        {
                            group_list.Add(HitomiIndex.Instance.index.Groups[group], new Dictionary <int, int>());
                        }
                    }
                }
            }

            foreach (var data in datas)
            {
                if (data.Key > 1125000)
                {
                    foreach (var metadata in data.Value)
                    {
                        var lang = "n/a";
                        if (metadata.Language >= 0)
                        {
                            lang = HitomiIndex.Instance.index.Languages[metadata.Language];
                        }
                        if (lang == Settings.Instance.Hitomi.Language && metadata.Groups != null)
                        {
                            foreach (var _group in metadata.Groups)
                            {
                                var group = HitomiIndex.Instance.index.Groups[_group];
                                if (group_list[group].ContainsKey(data.Key))
                                {
                                    group_list[group][data.Key] += 1;
                                }
                                else
                                {
                                    group_list[group].Add(data.Key, 1);
                                }
                            }
                        }
                    }
                }
            }

            foreach (var group in group_list)
            {
                HitomiAnalysisTrendElement e = new HitomiAnalysisTrendElement();
                e.name   = group.Key;
                e.points = new List <Point>();

                foreach (var pair in group.Value)
                {
                    e.points.Add(new Point(pair.Key, pair.Value));
                }
                samples.Add(e);
            }

            samples.Sort((a, b) => {
                int bb = 0;
                if (b.points.Count >= 1)
                {
                    bb = b.points.Last().Y;
                }
                if (b.points.Count > 1)
                {
                    for (int i = 0; i < b.points.Count - 2 && i < 5; i++)
                    {
                        bb += b.points[b.points.Count - i - 2].Y;
                    }
                }
                int aa = 0;
                if (a.points.Count >= 1)
                {
                    aa = a.points.Last().Y;
                }
                if (a.points.Count > 1)
                {
                    for (int i = 0; i < a.points.Count - 2 && i < 5; i++)
                    {
                        aa += a.points[a.points.Count - i - 2].Y;
                    }
                }

                return(bb.CompareTo(aa));
            });
            samples.RemoveRange(max_cnt * 2, samples.Count - max_cnt * 2);
        }
Exemple #11
0
        public void UpdateGroupsKoreanIncremetns(bool specifictag = false, int tag = -1)
        {
            samples.Clear();

            Dictionary <string, Dictionary <int, int> > group_list = new Dictionary <string, Dictionary <int, int> >();

            foreach (var metadata in HitomiIndex.Instance.metadata_collection)
            {
                var lang = "n/a";
                if (metadata.Language >= 0)
                {
                    lang = HitomiIndex.Instance.index.Languages[metadata.Language];
                }
                if (lang == Settings.Instance.Hitomi.Language && metadata.Groups != null && (!specifictag || (metadata.Tags != null && metadata.Tags.Contains(tag))))
                {
                    foreach (var group in metadata.Groups)
                    {
                        if (!group_list.ContainsKey(HitomiIndex.Instance.index.Groups[group]))
                        {
                            group_list.Add(HitomiIndex.Instance.index.Groups[group], new Dictionary <int, int>());
                        }
                    }
                }
            }

            foreach (var data in datas)
            {
                foreach (var metadata in data.Value)
                {
                    var lang = "n/a";
                    if (metadata.Language >= 0)
                    {
                        lang = HitomiIndex.Instance.index.Languages[metadata.Language];
                    }
                    if (lang == Settings.Instance.Hitomi.Language && metadata.Groups != null && (!specifictag || (metadata.Tags != null && metadata.Tags.Contains(tag))))
                    {
                        foreach (var _group in metadata.Groups)
                        {
                            var group = HitomiIndex.Instance.index.Groups[_group];
                            if (group_list[group].ContainsKey(data.Key))
                            {
                                group_list[group][data.Key] += 1;
                            }
                            else
                            {
                                group_list[group].Add(data.Key, 1);
                            }
                        }
                    }
                }
            }

            foreach (var group in group_list)
            {
                HitomiAnalysisTrendElement e = new HitomiAnalysisTrendElement();
                e.name   = group.Key;
                e.points = new List <Point>();
                int nujuk = 0;

                foreach (var pair in group.Value)
                {
                    nujuk += pair.Value;
                    e.points.Add(new Point(pair.Key, nujuk));
                }
                samples.Add(e);
            }

            samples.Sort((a, b) => b.points.Last().Y.CompareTo(a.points.Last().Y));
            if (samples.Count > max_cnt)
            {
                samples.RemoveRange(max_cnt, samples.Count - max_cnt);
            }
        }
        public void UpdateArtistsKoreanVariation()
        {
            samples.Clear();

            Dictionary <string, Dictionary <int, int> > artist_list = new Dictionary <string, Dictionary <int, int> >();

            foreach (var metadata in HitomiData.Instance.metadata_collection)
            {
                if (metadata.Language == Settings.Instance.Hitomi.Language && metadata.Artists != null)
                {
                    foreach (var artist in metadata.Artists.Where(artist => !artist_list.ContainsKey(artist)))
                    {
                        artist_list.Add(artist, new Dictionary <int, int>());
                    }
                }
            }

            foreach (var data in datas)
            {
                if (data.Key > 1125000)
                {
                    foreach (var metadata in data.Value)
                    {
                        if (metadata.Language == Settings.Instance.Hitomi.Language && metadata.Artists != null)
                        {
                            foreach (var artist in metadata.Artists)
                            {
                                if (artist_list[artist].ContainsKey(data.Key))
                                {
                                    artist_list[artist][data.Key] += 1;
                                }
                                else
                                {
                                    artist_list[artist].Add(data.Key, 1);
                                }
                            }
                        }
                    }
                }
            }

            foreach (var artist in artist_list)
            {
                HitomiAnalysisTrendElement e = new HitomiAnalysisTrendElement();
                e.name   = artist.Key;
                e.points = new List <Point>();

                foreach (var pair in artist.Value)
                {
                    e.points.Add(new Point(pair.Key, pair.Value));
                }
                samples.Add(e);
            }

            samples.Sort((a, b) => {
                int bb = 0;
                if (b.points.Count >= 1)
                {
                    bb = b.points.Last().Y;
                }
                if (b.points.Count > 1)
                {
                    for (int i = 0; i < b.points.Count - 2 && i < 5; i++)
                    {
                        bb += b.points[b.points.Count - i - 2].Y;
                    }
                }
                int aa = 0;
                if (a.points.Count >= 1)
                {
                    aa = a.points.Last().Y;
                }
                if (a.points.Count > 1)
                {
                    for (int i = 0; i < a.points.Count - 2 && i < 5; i++)
                    {
                        aa += a.points[a.points.Count - i - 2].Y;
                    }
                }

                return(bb.CompareTo(aa));
            });
            samples.RemoveRange(10, samples.Count - 10);
        }