From 52327f2bfda099d90ebc7b5b85dd68e04d684000 Mon Sep 17 00:00:00 2001 From: H4ck-rOOt Date: Mon, 30 Jan 2017 11:12:36 +0100 Subject: [PATCH] Merged Pull Request #10 with fixes --- LyndaDecryptor/Decryptor.cs | 6 ++++-- LyndaDecryptor/Program.cs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/LyndaDecryptor/Decryptor.cs b/LyndaDecryptor/Decryptor.cs index 77ac9e9..bf629b6 100644 --- a/LyndaDecryptor/Decryptor.cs +++ b/LyndaDecryptor/Decryptor.cs @@ -126,8 +126,10 @@ public void DecryptAll(string folderPath, string outputFolder = "") if (!Directory.Exists(folderPath)) throw new DirectoryNotFoundException(); - if (!string.IsNullOrWhiteSpace(outputFolder)) - OutputDirectory = Directory.Exists(outputFolder) ? new DirectoryInfo(outputFolder) : Directory.CreateDirectory(outputFolder); + if(string.IsNullOrWhiteSpace(outputFolder)) + outputFolder = Path.Combine(Path.GetDirectoryName(folderPath), "decrypted"); + + OutputDirectory = Directory.Exists(outputFolder) ? new DirectoryInfo(outputFolder) : Directory.CreateDirectory(outputFolder); 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); }