From 8f3083dd8f300586457dd51b8c26d6e35fa0741f Mon Sep 17 00:00:00 2001 From: anarh Date: Thu, 10 Nov 2016 21:57:00 +0100 Subject: [PATCH] Fixed bug: when no output directory was specified, database was specified and a whole folder was converted the files were not renamed according to the database. Use OutputFolder /OUT instead of outputpath from /F when converting an entire directory --- LyndaDecryptor/Decryptor.cs | 2 ++ LyndaDecryptor/Program.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/LyndaDecryptor/Decryptor.cs b/LyndaDecryptor/Decryptor.cs index 77ac9e9..ac195ed 100644 --- a/LyndaDecryptor/Decryptor.cs +++ b/LyndaDecryptor/Decryptor.cs @@ -128,6 +128,8 @@ public void DecryptAll(string folderPath, string outputFolder = "") if (!string.IsNullOrWhiteSpace(outputFolder)) OutputDirectory = Directory.Exists(outputFolder) ? new DirectoryInfo(outputFolder) : Directory.CreateDirectory(outputFolder); + if (OutputDirectory == null) + OutputDirectory = new DirectoryInfo(folderPath); foreach (string entry in Directory.EnumerateFiles(folderPath, "*.lynda", SearchOption.AllDirectories)) { diff --git a/LyndaDecryptor/Program.cs b/LyndaDecryptor/Program.cs index 996145b..b8784a2 100644 --- a/LyndaDecryptor/Program.cs +++ b/LyndaDecryptor/Program.cs @@ -46,7 +46,7 @@ static void Main(string[] args) if (decryptorOptions.UsageMode == Mode.Folder) - decryptor.DecryptAll(decryptorOptions.InputPath, decryptorOptions.OutputPath); + decryptor.DecryptAll(decryptorOptions.InputPath, decryptorOptions.OutputFolder); else if (decryptorOptions.UsageMode == Mode.File) decryptor.Decrypt(decryptorOptions.InputPath, decryptorOptions.OutputPath); }