Browse Source

分包小下载-压缩包文件夹替换逻辑

liyijie 1 year ago
parent
commit
10d6dbcd2e

+ 7 - 0
PDF Office/ViewModels/Dialog/ConverterDialogs/OCRDownloadProgressViewModel.cs

@@ -278,7 +278,14 @@ namespace PDF_Master.ViewModels.Dialog.ConverterDialogs
                         foreach (var entry in zip.Entries)
                         {
                             var extractionPath = System.IO.Path.Combine(destinationFolderPath, entry.FullName);
+                            string replacement = "OCREngine";
 
+                            int slashIndex = entry.FullName.IndexOf('/');
+                            if (slashIndex != -1)
+                            {
+                                string modifiedString = replacement + entry.FullName.Substring(slashIndex);
+                                extractionPath = System.IO.Path.Combine(destinationFolderPath, modifiedString);
+                            }
                             if (entry.Name == "")
                             {
                                 // 处理目录的情况,例如在ZIP文件中的文件夹