Beispiel #1
0
        private void MenuHitomi_Click(object sender, RoutedEventArgs e)
        {
            MainPanel.Children.Clear();
            LabelSetup();
            HitomiLoader hitomi = new HitomiLoader();

            hitomi.index = GetPage();
            hitomi.count = (int)Page_itemCount;
            hitomi.FastDefault();
            hitomi.FastParser();
        }
Beispiel #2
0
        private async void Hitomi_Search_TagOnly_Button_Click(object sender, RoutedEventArgs e)
        {
            string[] tags     = Hitomi_Search_TagOnly_Text.Text.Split(' ');
            string[] tagstart = Enum.GetNames(typeof(Tag.Types));
            tags = tags.Where(x => HiyobiTags.Tags.Select(y => y.name).Contains(x))
                   .Where(x => tagstart.Any(x.ToLower().StartsWith)).ToArray();
            if (tags.Length <= 0)
            {
                MessageBox.Show("검색 가능한 태그가 없습니다.");
                return;
            }
            List <int> idlist = new List <int>();
            int        index  = GetPage();

            foreach (string tag in tags)
            {
                InternetP parser = new InternetP();
                parser.url   = $"https://ltn.hitomi.la/tag/{tag}-all.nozomi";
                parser.index = index - 1;
                parser.count = (int)1000;
                int[] ids = parser.ByteArrayToIntArray(await parser.LoadNozomi());
                idlist = idlist.Concat(ids).ToList();
            }
            List <int> new_idlist = new List <int>();

            for (int i = 0; i < idlist.Count; i++)
            {
                int count = idlist.Count(y => y == idlist[i]);
                if (count == tags.Length)
                {
                    new_idlist.Add(idlist[i]);
                }
                if (new_idlist.Count >= (int)Page_itemCount)
                {
                    break;
                }
            }
            //idlist = idlist.Where(x => idlist.Count(y => y == x) == tags.Length).ToList();
            //_ = idlist;
            MainPanel.Children.Clear();
            LabelSetup();
            HitomiLoader hitomi = new HitomiLoader();

            hitomi.FastDefault();
            hitomi.FastParser(new_idlist.ToArray());
        }