private void ScanFolder() { if (project == null) { return; } if (!VideoData.ScanFolder(project)) { MessageBox.Show("扫描文件失败"); Program.log.Error($"扫描{project.Name}", new Exception("扫描失败")); } }
/// <summary> /// 扫描文件夹 按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ToolStripMenuItem_Click(object sender, EventArgs e) { bool scan = VideoData.ScanFolder(focusedfolder); if (!scan) { MessageBox.Show("扫描文件失败"); Program.log.Error("扫描文件失败", new Exception("扫描文件失败")); return; } MessageBox.Show("扫描文件已完成"); }
/// <summary> /// 自动截图 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void AutomaticToolStripMenuItem_Click(object sender, EventArgs e) { bool scan = VideoData.ScanFolder(focusedfolder); if (!scan) { return; } List <int> ids = VideoData.GetAllVideoPlay(focusedfolder.Name).Select(t => t.Id).ToList(); bool iswin = VideoData.AddAutomaticScreenshot(ids); if (!iswin) { MessageBox.Show("添加失败"); Program.log.Error($"添加批次{focusedfolder.Name}到自动截图失败"); return; } MessageBox.Show("添加成功"); Program.log.Info($"添加批次{focusedfolder.Name}到自动截图成功"); }
/// <summary> /// 添加查重 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void repetitionToolStripMenuItem_Click(object sender, EventArgs e) { bool scan = VideoData.ScanFolder(focusedfolder); if (!scan) { return; } List <int> ids = VideoData.GetAllVideoPlay(focusedfolder.Name).Select(t => t.Id).ToList(); bool iswin = VideoData.VideoRepetition(AppSettings.User.RealName, focusedfolder.Name + focusedfolder.Place, focusedfolder.Id, ids); if (!iswin) { MessageBox.Show("添加失败"); Program.log.Error($"添加视频查重,批次{focusedfolder.Name},失败"); return; } MessageBox.Show("添加成功"); Program.log.Info($"添加视频查重,批次{focusedfolder.Name},成功"); }