Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug preventing file rename in different cases #10

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions LyndaDecryptor/Decryptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down
2 changes: 1 addition & 1 deletion LyndaDecryptor/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch! seems i missed to change this one...

Copy link
Contributor Author

@mdomnita mdomnita Nov 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enjoy!
Also check the other change in Decryptor.cs. In case you don't give an output directory (using a /OUT parameter) and you give a database (using a /DB) it will go, search through the database, get the correct video name but will throw an error "Could not retrive media information from database...Falling back to default behaviour" because the outputDirectory is null/not set to an instance of an object.
I set it to the same directory as the input one by default if none is received, it works just fine like this and it creates all the folder and nice video file names structure in the same directory as the input files. Maybe another check and fix would also be nice here, if the /OUT parameter does not give a legal file path do the same thing and create the nice chapter folder structure in the input folder.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mdomnita Can you please give full command that I can use to convert whole folder while renaming files according to database.

else if (decryptorOptions.UsageMode == Mode.File)
decryptor.Decrypt(decryptorOptions.InputPath, decryptorOptions.OutputPath);
}
Expand Down