Fix Backups (#750)

* Fixed an issue where backups were failing due to files being in config directory

* Changed up the exception messages to be more clear when a unique constraint fails on adding a new series.

* Added the actual index that is causing the conflict.
This commit is contained in:
Joseph Milazzo 2021-11-14 07:19:59 -06:00 committed by GitHub
parent a24ca2b46b
commit ae5c6594e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 24 deletions

View file

@ -89,7 +89,7 @@ namespace API.Services.Tasks
_logger.LogDebug("Backing up to {BackupDirectory}", backupDirectory);
if (!DirectoryService.ExistOrCreate(backupDirectory))
{
_logger.LogError("Could not write to {BackupDirectory}; aborting backup", backupDirectory);
_logger.LogCritical("Could not write to {BackupDirectory}; aborting backup", backupDirectory);
return;
}
@ -107,7 +107,7 @@ namespace API.Services.Tasks
DirectoryService.ClearDirectory(tempDirectory);
_directoryService.CopyFilesToDirectory(
_backupFiles.Select(file => Path.Join(Directory.GetCurrentDirectory(), file)).ToList(), tempDirectory);
_backupFiles.Select(file => Path.Join(DirectoryService.ConfigDirectory, file)).ToList(), tempDirectory);
await CopyCoverImagesToBackupDirectory(tempDirectory);