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()); }
public async void Parser() { InternetP parser = new InternetP(); parser.index = (index - 1) * count; parser.count = count; parser.url = "https://ltn.hitomi.la/index-all.nozomi"; int[] ids = parser.ByteArrayToIntArray(await parser.LoadNozomi()); start(ids.Count()); foreach (int id in ids) { parser.index = id; Hitomi h = await parser.HitomiData2(); update(h, ids.ToList().IndexOf(id), ids.Count()); } end(); }
public async void FastParser() { InternetP parser = new InternetP(); parser.index = (index - 1) * count; parser.count = count; parser.url = "https://ltn.hitomi.la/index-all.nozomi"; int[] ids = parser.ByteArrayToIntArray(await parser.LoadNozomi()); FastParser(ids); /* * start(ids.Count()); * for (int i = 0; i < ids.Length; i++) * { * InternetP parser2 = new InternetP(); * parser2.index = ids[i]; * Hitomi h = await parser2.HitomiData(); * h.type = Hitomi.Type.Hitomi; * h.id = ids[i].ToString(); * update(h, i, ids.Count()); * } * end(); */ }