Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            string arg   = "";
            int    jobId = 0;

            if (args.Length == 0)
            {
                arg = " refresh " + 15;

                ScanDataBaseManager.DeleteRemoteScanMag();
            }
            else
            {
                var model = ScanDataBaseManager.GetFirstScanJob();

                if (model != null)
                {
                    var parameter = JsonConvert.DeserializeObject <ScanParameter>(model.ScanParameter);
                    parameter.ScanJobId = model.ScanJobId;

                    if (parameter != null && parameter.StartingPage != null && parameter.StartingPage.Count > 0)
                    {
                        arg   = string.Format("dolist {0} {1} {2}", string.Join(",", parameter.StartingPage), parameter.IsAsc, parameter.PageSize);
                        jobId = parameter.ScanJobId;

                        ScanDataBaseManager.SetScanJobFinish(jobId, -1);
                    }
                }
                else
                {
                    return;
                }
            }

            DoJob(arg, jobId);

            while (IsFinish)
            {
            }

            ScanDataBaseManager.SetScanJobFinish(jobId, 1, models.Count);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            string arg   = "";
            int    jobId = 0;

            model = ScanDataBaseManager.GetFirstScanJob();

            if (args.Length == 0)
            {
                arg = " refresh " + 15;

                ScanDataBaseManager.DeleteRemoteScanMag();
            }
            else if (args.Length == 1)
            {
                if (model != null)
                {
                    if (model.Website == "jav")
                    {
                        var parameter = JsonConvert.DeserializeObject <ScanParameter>(model.ScanParameter);
                        parameter.ScanJobId = model.ScanJobId;

                        if (parameter != null && parameter.StartingPage != null && parameter.StartingPage.Count > 0)
                        {
                            arg   = string.Format("dolist {0} {1} {2}", string.Join(",", parameter.StartingPage), parameter.IsAsc, parameter.PageSize);
                            jobId = parameter.ScanJobId;

                            ScanDataBaseManager.SetScanJobFinish(jobId, -1);

                            DoJob(arg, jobId);
                        }
                    }

                    if (model.Website == "bus")
                    {
                        var parameter = JsonConvert.DeserializeObject <ScanParameter>(model.ScanParameter);
                        parameter.ScanJobId = model.ScanJobId;

                        if (parameter != null && parameter.StartingPage != null && parameter.StartingPage.Count > 0)
                        {
                            jobId = parameter.ScanJobId;
                            ScanDataBaseManager.SetScanJobFinish(jobId, -1, parameter.PageSize * 30);

                            DoJob(arg, jobId, parameter);
                        }
                    }
                }
                else
                {
                    return;
                }
            }

            while (IsFinish)
            {
            }

            ScanDataBaseManager.SetScanJobFinish(jobId, 1, models.Count);

            new RestClient("https://api.day.app").Get("4z4uANLXpe8BXT3wAZVe9F/下载种子文件完成");
        }