From dfcc430ab137baa23c222a4c4be62c317d6a0e67 Mon Sep 17 00:00:00 2001 From: Serraniel Date: Sat, 16 Feb 2019 20:08:17 +0100 Subject: [PATCH] #27 Changed properties in the jobs and fixed old rescan code. Also set rescan to false (we may ask the user later). --- src/Discord Media Loader.Application/Classes/Job.cs | 6 ++++-- src/Discord Media Loader.Application/Classes/Settings.cs | 2 +- src/Discord Media Loader.Application/Core/Core.cs | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Discord Media Loader.Application/Classes/Job.cs b/src/Discord Media Loader.Application/Classes/Job.cs index 7ef2e1b..4ea1cfc 100644 --- a/src/Discord Media Loader.Application/Classes/Job.cs +++ b/src/Discord Media Loader.Application/Classes/Job.cs @@ -39,8 +39,7 @@ namespace DML.AppCore.Classes public int Id { get; set; } public ulong GuildId { get; set; } public ulong ChannelId { get; set; } - public double KnownTimestamp { get; set; } = 0; - private double StopTimestamp { get; set; } = 0; + public ulong LastMessageId { get; set; } private bool IsValid { get; set; } = true; internal JobState State { get; set; } = JobState.Idle; @@ -91,6 +90,7 @@ namespace DML.AppCore.Classes /// Returns true if the newest messages have been scanned. internal async Task Scan() { + /* Debug($"Starting scan of guild {GuildId} channel {ChannelId}..."); var result = new List(); @@ -220,6 +220,8 @@ namespace DML.AppCore.Classes } Debug($"Fisnished scan of guild {GuildId} channel {ChannelId}."); + */ + return false; } public void Stop() diff --git a/src/Discord Media Loader.Application/Classes/Settings.cs b/src/Discord Media Loader.Application/Classes/Settings.cs index f9fa783..4005110 100644 --- a/src/Discord Media Loader.Application/Classes/Settings.cs +++ b/src/Discord Media Loader.Application/Classes/Settings.cs @@ -31,7 +31,7 @@ namespace DML.Application.Classes public bool SkipExistingFiles { get; set; } = true; public int ThreadLimit { get; set; } = 50; public bool ShowStartUpHints { get; set; } = true; - public bool RescanRequired { get; set; } = true; + public bool RescanRequired { get; set; } = false; public bool UseRPC { get; set; } = false; public void Store() diff --git a/src/Discord Media Loader.Application/Core/Core.cs b/src/Discord Media Loader.Application/Core/Core.cs index 77e1a75..5c9193b 100644 --- a/src/Discord Media Loader.Application/Core/Core.cs +++ b/src/Discord Media Loader.Application/Core/Core.cs @@ -275,7 +275,7 @@ namespace DML.Application.Core if (Settings.RescanRequired) { Logger.Info("Restting timestamps"); - job.KnownTimestamp = 0; + job.LastMessageId = 0; job.Store(); } }