Add multichannel export to GUI

Closes #12
This commit is contained in:
Alexey Golub 2019-02-09 19:03:34 +02:00
parent 65c5df89f4
commit e4b0d60c40
13 changed files with 366 additions and 136 deletions

View file

@ -1,12 +1,19 @@
using System;
using System.IO;
using System.Linq;
using System.Text;
using DiscordChatExporter.Core.Models;
using Tyrrrz.Extensions;
namespace DiscordChatExporter.Core.Helpers
{
public static class ExportHelper
{
public static bool IsDirectoryPath(string path)
=> path.Last() == Path.DirectorySeparatorChar ||
path.Last() == Path.AltDirectorySeparatorChar ||
Path.GetExtension(path).IsBlank();
public static string GetDefaultExportFileName(ExportFormat format, Guild guild, Channel channel,
DateTime? from = null, DateTime? to = null)
{

View file

@ -121,9 +121,6 @@ namespace DiscordChatExporter.Core.Services
{
var result = new List<Message>();
// Report indeterminate progress
progress?.Report(-1);
// Get the snowflakes for the selected range
var firstId = from != null ? from.Value.ToSnowflake() : "0";
var lastId = to != null ? to.Value.ToSnowflake() : DateTime.MaxValue.ToSnowflake();