Exemplo n.º 1
0
        public ActionResult ScanJav()
        {
            #region  页面
            List <ScanMap> page = new List <ScanMap>();

            page.Add(new ScanMap()
            {
                Title = "新话题",
                Url   = "http://www.javlibrary.com/cn/vl_update.php?mode="
            });

            page.Add(new ScanMap()
            {
                Title = "新加入",
                Url   = "http://www.javlibrary.com/cn/vl_newentries.php?mode="
            });
            page.Add(new ScanMap()
            {
                Title = "最想要",
                Url   = "http://www.javlibrary.com/cn/vl_mostwanted.php?mode="
            });
            page.Add(new ScanMap()
            {
                Title = "高评价",
                Url   = "http://www.javlibrary.com/cn/vl_bestrated.php?mode="
            });
            page.Add(new ScanMap()
            {
                Title = "新发行",
                Url   = "http://www.javlibrary.com/cn/vl_newrelease.php?mode="
            });

            ViewData.Add("page", page);
            #endregion

            #region  演员
            var actress = JavDataBaseManager.GetActress();
            ViewData.Add("actress", actress);
            #endregion

            #region  类型
            var cate = JavDataBaseManager.GetCategories();
            ViewData.Add("cate", cate);
            #endregion

            #region  收藏
            var faviModel = ScanDataBaseManager.GetFaviScan();

            var favi = faviModel.GroupBy(x => x.Category).ToDictionary(x => x.Key, x => x.ToList());

            ViewData.Add("favi", favi);
            #endregion

            return(View());
        }
Exemplo n.º 2
0
        public static void CheckAvatorMatch()
        {
            Dictionary <string, List <string> > matchRecord = new Dictionary <string, List <string> >();
            List <string> avators = new List <string>();
            var           folder  = @"G:\Github\AllInOneAV\Setting\avator";
            var           avs     = JavDataBaseManager.GetActress();

            foreach (var f in Directory.GetDirectories(folder))
            {
                foreach (var a in Directory.GetFiles(f))
                {
                    if (!avators.Contains(a))
                    {
                        avators.Add(a);
                    }
                }
            }

            foreach (var a in avs)
            {
                foreach (var m in avators.OrderByDescending(x => x.Length))
                {
                    if (m.Contains(a.Name))
                    {
                        if (!matchRecord.ContainsKey(a.Name))
                        {
                            matchRecord.Add(a.Name, new List <string>()
                            {
                                m.Replace(@"G:\Github\AllInOneAV\Setting\", @"\Imgs\").Replace(@"\", "/")
                            });
                            break;
                        }
                    }
                }
            }

            foreach (var m in matchRecord)
            {
                ScanDataBaseManager.UpdateFaviAvator(m.Key, m.Value.FirstOrDefault());
            }

            Console.ReadKey();
        }
Exemplo n.º 3
0
        public static void MatchAvator()
        {
            var avatorFolderPrefix = @"C:\Setting\演员头像\";
            var actress            = JavDataBaseManager.GetActress();

            int found    = 0;
            int notFound = 0;

            foreach (var act in actress)
            {
                bool has        = false;
                var  realFolder = avatorFolderPrefix + act.Name[0] + @"\";

                if (Directory.Exists(realFolder))
                {
                    var avators = Directory.GetFiles(realFolder);

                    foreach (var avator in avators)
                    {
                        if (avator.Contains(act.Name))
                        {
                            Console.WriteLine(act.Name + avator);
                            found++;
                            has = true;
                            break;
                        }
                    }
                }

                if (!has)
                {
                    notFound++;
                }
            }

            Console.WriteLine("找到 " + found + " 未找到 " + notFound);
        }
Exemplo n.º 4
0
        public static void BackUpJav(string drive)
        {
            var dateStr       = DateTime.Today.ToString("yyyyMMdd");
            var extension     = ".json";
            var folder        = drive + @"\Github\AllInOneAV\Scripts\\";
            var rawFolder     = folder + "dataRaw\\";
            var zipFileFoler  = folder + "dataZip\\";
            var zipFile       = zipFileFoler + dateStr + ".zip";
            var avFile        = rawFolder + "av" + dateStr + extension;
            var actressFile   = rawFolder + "actress" + dateStr + extension;
            var directorFile  = rawFolder + "director" + dateStr + extension;
            var companyFile   = rawFolder + "company" + dateStr + extension;
            var publisherFile = rawFolder + "publisher" + dateStr + extension;

            StreamWriter sw = null;

            var avs       = JavDataBaseManager.GetAllAV();
            var actress   = JavDataBaseManager.GetActress();
            var director  = JavDataBaseManager.GetDirector();
            var company   = JavDataBaseManager.GetCompany();
            var publisher = JavDataBaseManager.GetPublisher();

            if (!Directory.Exists(rawFolder))
            {
                Directory.CreateDirectory(rawFolder);
            }

            if (!Directory.Exists(folder))
            {
                Directory.CreateDirectory(folder);
            }

            if (!Directory.Exists(zipFileFoler))
            {
                Directory.CreateDirectory(zipFileFoler);
            }

            foreach (var file in new DirectoryInfo(rawFolder).GetFiles())
            {
                file.Delete();
                Thread.Sleep(50);
            }

            if (!File.Exists(avFile))
            {
                File.Create(avFile).Close();

                sw = new StreamWriter(avFile);
                sw.WriteLine(JsonConvert.SerializeObject(avs));
                sw.Close();
            }

            if (!File.Exists(actressFile))
            {
                File.Create(actressFile).Close();

                sw = new StreamWriter(actressFile);
                sw.WriteLine(JsonConvert.SerializeObject(actress));
                sw.Close();
            }

            if (!File.Exists(directorFile))
            {
                File.Create(directorFile).Close();

                sw = new StreamWriter(directorFile);
                sw.WriteLine(JsonConvert.SerializeObject(director));
                sw.Close();
            }

            if (!File.Exists(companyFile))
            {
                File.Create(companyFile).Close();

                sw = new StreamWriter(companyFile);
                sw.WriteLine(JsonConvert.SerializeObject(company));
                sw.Close();
            }

            if (!File.Exists(publisherFile))
            {
                File.Create(publisherFile).Close();

                sw = new StreamWriter(publisherFile);
                sw.WriteLine(JsonConvert.SerializeObject(publisher));
                sw.Close();
            }
        }