unify some config params, and move datfile location to app data

This commit is contained in:
13xforever
2025-07-05 22:16:00 +05:00
parent 2259febe87
commit 4ecb64e1be
2 changed files with 11 additions and 8 deletions

View File

@@ -87,7 +87,14 @@ internal static class Config
public static string PreferredFontFamily => config.GetValue(nameof(PreferredFontFamily), "");
public static string LogPath => config.GetValue(nameof(LogPath), "./logs/"); // paths are relative to the working directory
public static string IrdCachePath => config.GetValue(nameof(IrdCachePath), "./ird/");
public static string RedumpDatfileCachePath => config.GetValue(nameof(RedumpDatfileCachePath), "./datfile/");
public static string BotAppDataFolder => config.GetValue(
nameof(BotAppDataFolder),
Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
"compat-bot"
)
);
public static string RedumpDatfileCachePath => Path.Combine(BotAppDataFolder, "compat-bot", "datfile");
public static string RenameNameSuffix => config.GetValue(nameof(RenameNameSuffix), " (Rule 7)");
public static string OcrBackend => config.GetValue(nameof(OcrBackend), "auto"); // possible values: auto, tesseract, florence2, azure
@@ -248,6 +255,7 @@ internal static class Config
var fileTarget = new FileTarget("logfile") {
FileName = CurrentLogPath,
ArchiveEvery = FileArchivePeriod.Day,
MaxArchiveDays = 30,
//ArchiveSuffixFormat = ".{1:yyyyMMdd}.{0:00}",
ArchiveNumbering = ArchiveNumberingMode.DateAndSequence,
ConcurrentWrites = false,
@@ -334,4 +342,4 @@ internal static class Config
var branch = await GitRunner.Exec("rev-parse --abbrev-ref HEAD", cancellationToken);
GitRevision = $"{commit} on {branch}";
}
}
}