From 52684c264f49342834d5b5a38e0da512f537acc8 Mon Sep 17 00:00:00 2001 From: Oleksii Holub Date: Wed, 31 Oct 2018 17:35:28 +0200 Subject: [PATCH] Change order of parameters in ExportService.Export --- DiscordChatExporter.Cli/Verbs/ExportChatVerb.cs | 2 +- DiscordChatExporter.Core/Services/ExportService.cs | 4 ++-- DiscordChatExporter.Core/Services/IExportService.cs | 2 +- DiscordChatExporter.Gui/ViewModels/MainViewModel.cs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/DiscordChatExporter.Cli/Verbs/ExportChatVerb.cs b/DiscordChatExporter.Cli/Verbs/ExportChatVerb.cs index d2d619c..1883beb 100644 --- a/DiscordChatExporter.Cli/Verbs/ExportChatVerb.cs +++ b/DiscordChatExporter.Cli/Verbs/ExportChatVerb.cs @@ -42,7 +42,7 @@ namespace DiscordChatExporter.Cli.Verbs } // Export - exportService.Export(Options.ExportFormat, filePath, chatLog); + exportService.Export(chatLog, filePath, Options.ExportFormat); // Print result Console.WriteLine($"Exported chat to [{filePath}]"); diff --git a/DiscordChatExporter.Core/Services/ExportService.cs b/DiscordChatExporter.Core/Services/ExportService.cs index 0d623aa..6b74da8 100644 --- a/DiscordChatExporter.Core/Services/ExportService.cs +++ b/DiscordChatExporter.Core/Services/ExportService.cs @@ -15,7 +15,7 @@ namespace DiscordChatExporter.Core.Services _settingsService = settingsService; } - public void Export(ExportFormat format, string filePath, ChatLog log) + public void Export(ChatLog chatLog, string filePath, ExportFormat format) { // Create template loader var loader = new TemplateLoader(); @@ -35,7 +35,7 @@ namespace DiscordChatExporter.Core.Services }; // Create template model - var templateModel = new TemplateModel(format, log, _settingsService.DateFormat); + var templateModel = new TemplateModel(format, chatLog, _settingsService.DateFormat); context.PushGlobal(templateModel.GetScriptObject()); // Create directory diff --git a/DiscordChatExporter.Core/Services/IExportService.cs b/DiscordChatExporter.Core/Services/IExportService.cs index 938c4d3..c4f8ea1 100644 --- a/DiscordChatExporter.Core/Services/IExportService.cs +++ b/DiscordChatExporter.Core/Services/IExportService.cs @@ -4,6 +4,6 @@ namespace DiscordChatExporter.Core.Services { public interface IExportService { - void Export(ExportFormat format, string filePath, ChatLog log); + void Export(ChatLog chatLog, string filePath, ExportFormat format); } } \ No newline at end of file diff --git a/DiscordChatExporter.Gui/ViewModels/MainViewModel.cs b/DiscordChatExporter.Gui/ViewModels/MainViewModel.cs index 2459452..6554bc1 100644 --- a/DiscordChatExporter.Gui/ViewModels/MainViewModel.cs +++ b/DiscordChatExporter.Gui/ViewModels/MainViewModel.cs @@ -260,7 +260,7 @@ namespace DiscordChatExporter.Gui.ViewModels var chatLog = await _chatLogService.GetChatLogAsync(token, guild, channel, from, to, progressHandler); // Export - _exportService.Export(format, filePath, chatLog); + _exportService.Export(chatLog, filePath, format); // Open Process.Start(filePath);