Exemplo n.º 1
0
        private static List <MissingCheckModel> DoAllRelatedJav(string table, string content)
        {
            List <MissingCheckModel> ret = new List <MissingCheckModel>();
            var avs = JavDataBaseManager.GetAllAV();

            switch (table)
            {
            case "category":
                avs = avs.Where(x => x.Category.Contains(content)).ToList();
                break;

            case "actress":
                avs = avs.Where(x => x.Actress.Contains(content)).ToList();
                break;

            case "prefix":
                avs = avs.Where(x => x.ID.StartsWith(content.ToUpper() + "-")).ToList();
                break;
            }

            foreach (var av in avs)
            {
                MissingCheckModel mcm = new MissingCheckModel
                {
                    Av      = av,
                    Fi      = new List <FileInfo>(),
                    IsMatch = false,
                    Seeds   = new List <SeedMagnetSearchModel>()
                };

                ret.Add(mcm);
            }

            return(ret.OrderBy(x => x.Av.ID).ToList());
        }
Exemplo n.º 2
0
        private void listView1_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left && listView1.SelectedItems.Count > 0)
            {
                MissingCheckModel mcm = (MissingCheckModel)listView1.SelectedItems[0].Tag;

                Clipboard.SetDataObject(mcm.Av.ID);

                listView1.SelectedItems[0].BackColor = Color.Blue;
            }

            if (e.Button == MouseButtons.Right && listView1.SelectedItems.Count > 0)
            {
                StringBuilder sb = new StringBuilder();

                foreach (ListViewItem lvi in listView1.SelectedItems)
                {
                    var seeds = ((MissingCheckModel)lvi.Tag);
                    if (seeds != null && seeds.Seeds.Count > 0)
                    {
                        foreach (var seed in seeds.Seeds)
                        {
                            sb.AppendLine(seed.MagUrl);
                        }
                    }
                }

                Clipboard.SetDataObject(sb.ToString());
                Message ms = new Message();
                ms.ShowDialog();
            }
        }