diff --git a/EvernoteToNotionChrome/App.xaml.cs b/EvernoteToNotionChrome/App.xaml.cs index 734f966..bf9d9d8 100644 --- a/EvernoteToNotionChrome/App.xaml.cs +++ b/EvernoteToNotionChrome/App.xaml.cs @@ -51,7 +51,7 @@ private static void InitializeCefSharp() //硬件加速设置 setting.CefCommandLineArgs.Add("--enable-media-stream", "1"); //setting.CefCommandLineArgs.Add("disable-gpu", "0"); - setting.SetOffScreenRenderingBestPerformanceArgs(); + //setting.SetOffScreenRenderingBestPerformanceArgs(); //setting.CefCommandLineArgs.Add("disable-gpu", "1"); //setting.CefCommandLineArgs.Add("disable-gpu-compositing", "1"); //setting.CefCommandLineArgs.Add("enable-begin-frame-scheduling", "1"); diff --git a/EvernoteToNotionChrome/MainWindow.xaml b/EvernoteToNotionChrome/MainWindow.xaml index 76655da..24f18eb 100644 --- a/EvernoteToNotionChrome/MainWindow.xaml +++ b/EvernoteToNotionChrome/MainWindow.xaml @@ -20,7 +20,7 @@ - + diff --git a/EvernoteToNotionChrome/MainWindow.xaml.cs b/EvernoteToNotionChrome/MainWindow.xaml.cs index 021279d..f728d59 100644 --- a/EvernoteToNotionChrome/MainWindow.xaml.cs +++ b/EvernoteToNotionChrome/MainWindow.xaml.cs @@ -64,12 +64,14 @@ private void Window_Loaded(object sender, RoutedEventArgs e) } - private async void TestDrag_Click(object sender, RoutedEventArgs e) + private async void ButtonStart_Click(object sender, RoutedEventArgs e) { + ButtonStart.IsEnabled = false; var path = TextBoxPath.Text; await Task.Run(() => { StartWithPath(path); - }); + }); + ButtonStart.IsEnabled = true; } private void Browser_Loaded(object sender, RoutedEventArgs e) diff --git a/EvernoteToNotionChrome/Service/HtmlManager.cs b/EvernoteToNotionChrome/Service/HtmlManager.cs index 55412bd..7c212a6 100644 --- a/EvernoteToNotionChrome/Service/HtmlManager.cs +++ b/EvernoteToNotionChrome/Service/HtmlManager.cs @@ -19,6 +19,15 @@ public static void UploadHtmlData(string filePath) doc.Load(filePath); var path = Path.GetDirectoryName(filePath); + var savePath = path + @"\Replace\" + Path.GetFileName(filePath); + + if (File.Exists(savePath)) + { + //已经存在 不继续处理 + return; + } + + if (!Directory.Exists(path + @"\Replace\")) { Directory.CreateDirectory(path + @"\Replace\"); @@ -87,7 +96,7 @@ public static void UploadHtmlData(string filePath) Debug.WriteLine(docString); - File.WriteAllText(path + @"\Replace\" + Path.GetFileName(filePath), docString); + File.WriteAllText(savePath, docString); }