Add feature #627 and fix bug #628

- Feature: Option to overwrite existing audio files when moving to Books
- Bugfix: Do not set liberated status if moving files fails.
This commit is contained in:
Mbucari 2023-06-14 10:51:43 -06:00
parent 7347244f0a
commit 46f6ba1710
10 changed files with 1157 additions and 1034 deletions

View file

@ -73,8 +73,23 @@ namespace FileLiberator
}
else
{
var realMp3Path = FileUtility.SaferMoveToValidPath(mp3File.Name, proposedMp3Path, Configuration.Instance.ReplacementCharacters, "mp3");
OnFileCreated(libraryBook, realMp3Path);
try
{
var realMp3Path
= FileUtility.SaferMoveToValidPath(
mp3File.Name,
proposedMp3Path,
Configuration.Instance.ReplacementCharacters,
extension: "mp3",
Configuration.Instance.OverwriteExisting);
OnFileCreated(libraryBook, realMp3Path);
}
catch
{
return new StatusHandler { "Failed to move decrypted files to Books directory" };
throw;
}
}
}
catch (Exception ex)