diff --git a/URLNotesGrabberCORE/DataAccess.cs b/URLNotesGrabberCORE/DataAccess.cs index 22a6713..2616a7c 100644 --- a/URLNotesGrabberCORE/DataAccess.cs +++ b/URLNotesGrabberCORE/DataAccess.cs @@ -1601,7 +1601,7 @@ namespace URLNotesGrabberCORE public static void Initialize(IConfiguration config, string? dbPath, string configFilePath, string? overrideSection = null) { - _dbPath = dbPath ?? "..\\..\\..\\tl.db"; + _dbPath = dbPath ?? throw new ArgumentNullException(nameof(dbPath)); _configFilePath = configFilePath; EnsureStateTableExists(); diff --git a/URLNotesGrabberCORE/Program.cs b/URLNotesGrabberCORE/Program.cs index f28bed6..2e2a875 100644 --- a/URLNotesGrabberCORE/Program.cs +++ b/URLNotesGrabberCORE/Program.cs @@ -85,8 +85,8 @@ namespace URLNotesGrabberCORE args = filteredArgs.ToArray(); string? dbPath = config["appSettings:PathDB"]; - if (string.IsNullOrWhiteSpace(dbPath)) - dbPath = Path.Combine(Directory.GetCurrentDirectory(), "..", "..", "..", "tl.db"); + if (string.IsNullOrEmpty(dbPath)) + throw new InvalidOperationException("PathDB is not configured in appsettings.json"); ApiKeyPool.Initialize(config, dbPath, "appsettings.json", apiExplicitlySet ? apiSectionName : null);