diff --git a/Discord Media Loader.Application/Classes/Core.cs b/Discord Media Loader.Application/Classes/Core.cs index 4cef719..99ffc7c 100644 --- a/Discord Media Loader.Application/Classes/Core.cs +++ b/Discord Media Loader.Application/Classes/Core.cs @@ -92,8 +92,13 @@ namespace DML.Application.Classes } Logger.Debug("Loading database..."); +#if DEBUG + Database = new LiteDatabase(Path.Combine(DataDirectory, "config.debug.db")); + Database.Log.Logging += (message) => Logger.Trace($"LiteDB: {message}"); +#else Database = new LiteDatabase(Path.Combine(DataDirectory, "config.db")); Database.Log.Logging += (message) => Logger.Trace($"LiteDB: {message}"); +#endif Logger.Debug("Loading settings collection out of database..."); var settingsDB = Database.GetCollection("settings"); @@ -221,7 +226,11 @@ namespace DML.Application.Classes } if (Settings.RescanRequired) + { + Logger.Info("Restting timestamps"); job.KnownTimestamp = 0; + job.Store(); + } } Settings.RescanRequired = false; diff --git a/Discord Media Loader.Application/Classes/Job.cs b/Discord Media Loader.Application/Classes/Job.cs index 8fc31e2..af7de1e 100644 --- a/Discord Media Loader.Application/Classes/Job.cs +++ b/Discord Media Loader.Application/Classes/Job.cs @@ -167,6 +167,8 @@ namespace DML.AppCore.Classes { Trace("Updating StopTimestamp for next scan..."); StopTimestamp = SweetUtils.DateTimeToUnixTimeStamp(result[result.Count - 1].CreatedAt.UtcDateTime); + KnownTimestamp = StopTimestamp; + Store(); } Debug($"Fisnished scan of guild {GuildId} channel {ChannelId}.");