From c8da56749cc062dbe479db6bb0fa999f85800a4b Mon Sep 17 00:00:00 2001 From: Qstick Date: Thu, 2 Jan 2020 19:01:39 -0500 Subject: [PATCH] New: Added version number to backup filename Co-Authored-By: taloth --- src/NzbDrone.Core/Backup/BackupService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/Backup/BackupService.cs b/src/NzbDrone.Core/Backup/BackupService.cs index 6ad56ab04..43def029c 100644 --- a/src/NzbDrone.Core/Backup/BackupService.cs +++ b/src/NzbDrone.Core/Backup/BackupService.cs @@ -39,7 +39,7 @@ namespace NzbDrone.Core.Backup private string _backupTempFolder; - public static readonly Regex BackupFileRegex = new Regex(@"lidarr_backup_[._0-9]+\.zip", RegexOptions.Compiled | RegexOptions.IgnoreCase); + public static readonly Regex BackupFileRegex = new Regex(@"lidarr_backup_(v[0-9.]+_)?[._0-9]+\.zip", RegexOptions.Compiled | RegexOptions.IgnoreCase); public BackupService(IMainDatabase maindDb, IMakeDatabaseBackup makeDatabaseBackup, @@ -69,7 +69,7 @@ namespace NzbDrone.Core.Backup _diskProvider.EnsureFolder(_backupTempFolder); _diskProvider.EnsureFolder(GetBackupFolder(backupType)); - var backupFilename = string.Format("lidarr_backup_{0:yyyy.MM.dd_HH.mm.ss}.zip", DateTime.Now); + var backupFilename = string.Format("lidarr_backup_v{0}_{1:yyyy.MM.dd_HH.mm.ss}.zip", BuildInfo.Version, DateTime.Now); var backupPath = Path.Combine(GetBackupFolder(backupType), backupFilename); Cleanup();