public void BeginDownLoad() { if (ActorList.Count == 0) { this.State = DownLoadState.Completed; return; } //先根据 BusActress.sqlite 获得 id List <Actress> actresslist = new List <Actress>(); foreach (Actress item in ActorList) { if (item != null && (item.smallimage == null || string.IsNullOrEmpty(item.birthday))) { Actress actress = item; MySqlite db = new MySqlite("BusActress"); if (item.id == "") { actress.id = db.GetInfoBySql($"select id from censored where name='{item.name}'"); if (item.imageurl == null) { actress.imageurl = db.GetInfoBySql($"select smallpicurl from censored where id='{actress.id}'"); } } else { if (item.imageurl == null) { actress.imageurl = db.GetInfoBySql($"select smallpicurl from censored where id='{actress.id}'"); } } db.CloseDB(); actresslist.Add(actress); } } ProgressBarUpdate.maximum = actresslist.Count; //TODO for (int i = 0; i < actresslist.Count; i++) { Console.WriteLine("开始进程 " + i); Thread threadObject = new Thread(DownLoad); threadObject.Start(actresslist[i]); } }
public void BeginDownLoad() { if (ActorList.Count == 0) { this.State = DownLoadState.Completed; return; } //先根据 BusActress.sqlite 获得 id List <Actress> actresslist = new List <Actress>(); foreach (Actress item in ActorList) { if (item != null && (item.smallimage == null || string.IsNullOrEmpty(item.birthday))) { Actress actress = item; MySqlite db = new MySqlite("BusActress"); if (string.IsNullOrEmpty(item.id)) { actress.id = db.GetInfoBySql($"select id from censored where name='{item.name}'"); } db.CloseDB(); if (string.IsNullOrEmpty(item.imageurl)) { //TODO 没法解决演员头像骑兵和步兵的问题 //默认骑兵吧,反正拍过步兵的肯定也拍过骑兵 //拼接网址 actress.imageurl = $"{JvedioServers.Bus.Url}pics/actress/{item.id}_a.jpg"; } actresslist.Add(actress); } } ProgressBarUpdate.maximum = actresslist.Count; for (int i = 0; i < actresslist.Count; i++) { Console.WriteLine("开始进程 " + i); Thread threadObject = new Thread(DownLoad); threadObject.Start(actresslist[i]); } }