From 125b81e3e5ca983c0ce09d80de3a56353693581d Mon Sep 17 00:00:00 2001 From: Chomp Date: Tue, 17 Jun 2025 08:52:00 +0100 Subject: [PATCH] Updated private methods inside `BackupService` to protected --- .../SPTarkov.Server.Core/Services/BackupService.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Services/BackupService.cs b/Libraries/SPTarkov.Server.Core/Services/BackupService.cs index c0283daa..cb732645 100644 --- a/Libraries/SPTarkov.Server.Core/Services/BackupService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/BackupService.cs @@ -227,7 +227,7 @@ public class BackupService /// /// The directory to search for backup files. /// List of sorted backup file paths. - private List GetBackupPaths(string dir) + protected List GetBackupPaths(string dir) { var backups = _fileUtil.GetDirectories(dir).ToList(); backups.Sort(CompareBackupDates); @@ -241,7 +241,7 @@ public class BackupService /// The name of the first backup folder. /// The name of the second backup folder. /// The difference in time between the two dates in milliseconds, or `null` if either date is invalid. - private int CompareBackupDates(string a, string b) + protected int CompareBackupDates(string a, string b) { var dateA = ExtractDateFromFolderName(a); var dateB = ExtractDateFromFolderName(b); @@ -253,13 +253,13 @@ public class BackupService return (int) (dateA.Value.ToFileTimeUtc() - dateB.Value.ToFileTimeUtc()); } - + /// /// Extracts a date from a folder name string formatted as `YYYY-MM-DD_hh-mm-ss`. /// /// The name of the folder from which to extract the date. /// A DateTime object if the folder name is in the correct format, otherwise null. - private DateTime? ExtractDateFromFolderName(string folderPath) + protected DateTime? ExtractDateFromFolderName(string folderPath) { var folderName = Path.GetFileName(folderPath); @@ -278,7 +278,7 @@ public class BackupService /// /// List of backup file names to be removed. /// A promise that resolves when all specified backups have been removed. - private void RemoveExcessBackups(List backupFilenames) + protected void RemoveExcessBackups(List backupFilenames) { var filePathsToDelete = backupFilenames.Select(x => x); foreach (var pathToDelete in filePathsToDelete)