From 57db3edc8af1f7bb4550d2ed76a7858882e3a75a Mon Sep 17 00:00:00 2001 From: Serraniel Date: Sun, 20 May 2018 16:22:04 +0200 Subject: [PATCH] Fixed nuget referencing to SweetLib and maintained code so it will compile with current SweetLib Version --- DML.Client/DML.Client.csproj | 4 ---- Discord Media Loader.Application/Classes/Job.cs | 5 +++-- .../Classes/JobScheduler.cs | 5 +++-- .../DML.Application.csproj | 10 ++++++---- Discord Media Loader.Application/app.config | 16 ++++++++++++++++ Discord Media Loader.Application/packages.config | 2 ++ Discord Media Loader.sln | 8 +------- Discord Media Loader/App.config | 16 ++++++++++++++++ 8 files changed, 47 insertions(+), 19 deletions(-) diff --git a/DML.Client/DML.Client.csproj b/DML.Client/DML.Client.csproj index 4b6dd43..3bcc684 100644 --- a/DML.Client/DML.Client.csproj +++ b/DML.Client/DML.Client.csproj @@ -8,8 +8,4 @@ - - - - diff --git a/Discord Media Loader.Application/Classes/Job.cs b/Discord Media Loader.Application/Classes/Job.cs index a2ea874..1b5c8d0 100644 --- a/Discord Media Loader.Application/Classes/Job.cs +++ b/Discord Media Loader.Application/Classes/Job.cs @@ -7,6 +7,7 @@ using Discord.WebSocket; using DML.Application.Classes; using DML.Client; using SweetLib.Utils; +using SweetLib.Utils.Extensions; using static SweetLib.Utils.Logger.Logger; namespace DML.AppCore.Classes @@ -136,7 +137,7 @@ namespace DML.AppCore.Classes lastId = m.Id; } - if (SweetUtils.DateTimeToUnixTimeStamp(m.CreatedAt.UtcDateTime) <= StopTimestamp) + if (m.CreatedAt.UtcDateTime.ToUnixTimeStamp() <= StopTimestamp) { Debug("Found a message with a known timestamp...Stopping scan."); finished = true; @@ -163,7 +164,7 @@ namespace DML.AppCore.Classes if (result.Count > 0) { Trace("Updating StopTimestamp for next scan..."); - StopTimestamp = SweetUtils.DateTimeToUnixTimeStamp(result[result.Count - 1].CreatedAt.UtcDateTime); + StopTimestamp = result[result.Count - 1].CreatedAt.UtcDateTime.ToUnixTimeStamp(); } Debug($"Fisnished scan of guild {GuildId} channel {ChannelId}."); diff --git a/Discord Media Loader.Application/Classes/JobScheduler.cs b/Discord Media Loader.Application/Classes/JobScheduler.cs index 0d48177..6a88229 100644 --- a/Discord Media Loader.Application/Classes/JobScheduler.cs +++ b/Discord Media Loader.Application/Classes/JobScheduler.cs @@ -8,6 +8,7 @@ using Discord; using Discord.WebSocket; using DML.Application.Classes; using SweetLib.Utils; +using SweetLib.Utils.Extensions; using SweetLib.Utils.Logger; namespace DML.AppCore.Classes @@ -244,7 +245,7 @@ namespace DML.AppCore.Classes fileName = fileName.Replace("%guild%", serverName) .Replace("%channel%", channelName) - .Replace("%timestamp%", SweetUtils.DateTimeToUnixTimeStamp(message.CreatedAt.UtcDateTime).ToString()) + .Replace("%timestamp%", message.CreatedAt.UtcDateTime.ToUnixTimeStamp().ToString()) .Replace("%name%", a.Filename) .Replace("%id%", a.Id.ToString()); @@ -277,7 +278,7 @@ namespace DML.AppCore.Classes Logger.Debug($"Downloaded attachment {a.Id}."); Logger.Trace("Updating known timestamp for job..."); - job.KnownTimestamp = SweetUtils.DateTimeToUnixTimeStamp(message.CreatedAt.UtcDateTime); + job.KnownTimestamp = message.CreatedAt.UtcDateTime.ToUnixTimeStamp(); job.Store(); } finally diff --git a/Discord Media Loader.Application/DML.Application.csproj b/Discord Media Loader.Application/DML.Application.csproj index 02bf1f5..0e3a4d2 100644 --- a/Discord Media Loader.Application/DML.Application.csproj +++ b/Discord Media Loader.Application/DML.Application.csproj @@ -61,6 +61,9 @@ ..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll + + ..\packages\Microsoft.Win32.Registry.4.3.0\lib\net46\Microsoft.Win32.Registry.dll + ..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll @@ -83,6 +86,9 @@ ..\packages\SharpRaven.2.2.0\lib\net45\SharpRaven.dll + + ..\packages\SweetLib.0.2.1-alpha\lib\netstandard1.3\SweetLib.dll + ..\packages\System.AppContext.4.3.0\lib\net46\System.AppContext.dll @@ -207,10 +213,6 @@ - - {02c1f8ef-32f2-4e77-a36d-79129402af37} - SweetLib - {045eb4a1-34e7-47e0-867e-e10c40505095} DML.Client diff --git a/Discord Media Loader.Application/app.config b/Discord Media Loader.Application/app.config index d5170f1..05e0aae 100644 --- a/Discord Media Loader.Application/app.config +++ b/Discord Media Loader.Application/app.config @@ -18,6 +18,22 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Discord Media Loader.Application/packages.config b/Discord Media Loader.Application/packages.config index d3092d0..9142f47 100644 --- a/Discord Media Loader.Application/packages.config +++ b/Discord Media Loader.Application/packages.config @@ -11,11 +11,13 @@ + + diff --git a/Discord Media Loader.sln b/Discord Media Loader.sln index 8124baf..09f9aa3 100644 --- a/Discord Media Loader.sln +++ b/Discord Media Loader.sln @@ -7,9 +7,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Discord Media Loader", "Dis EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DML.Application", "Discord Media Loader.Application\DML.Application.csproj", "{C130DE6A-3237-42B5-BE9F-783D1CD104C6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SweetLib", "..\SweetLib\SweetLib\SweetLib.csproj", "{02C1F8EF-32F2-4E77-A36D-79129402AF37}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DML.Client", "DML.Client\DML.Client.csproj", "{045EB4A1-34E7-47E0-867E-E10C40505095}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DML.Client", "DML.Client\DML.Client.csproj", "{045EB4A1-34E7-47E0-867E-E10C40505095}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -25,10 +23,6 @@ Global {C130DE6A-3237-42B5-BE9F-783D1CD104C6}.Debug|Any CPU.Build.0 = Debug|Any CPU {C130DE6A-3237-42B5-BE9F-783D1CD104C6}.Release|Any CPU.ActiveCfg = Release|Any CPU {C130DE6A-3237-42B5-BE9F-783D1CD104C6}.Release|Any CPU.Build.0 = Release|Any CPU - {02C1F8EF-32F2-4E77-A36D-79129402AF37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {02C1F8EF-32F2-4E77-A36D-79129402AF37}.Debug|Any CPU.Build.0 = Debug|Any CPU - {02C1F8EF-32F2-4E77-A36D-79129402AF37}.Release|Any CPU.ActiveCfg = Release|Any CPU - {02C1F8EF-32F2-4E77-A36D-79129402AF37}.Release|Any CPU.Build.0 = Release|Any CPU {045EB4A1-34E7-47E0-867E-E10C40505095}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {045EB4A1-34E7-47E0-867E-E10C40505095}.Debug|Any CPU.Build.0 = Debug|Any CPU {045EB4A1-34E7-47E0-867E-E10C40505095}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/Discord Media Loader/App.config b/Discord Media Loader/App.config index 7cf02b2..1974fd7 100644 --- a/Discord Media Loader/App.config +++ b/Discord Media Loader/App.config @@ -21,6 +21,22 @@ + + + + + + + + + + + + + + + +