mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-06-06 09:31:16 -04:00
Small clenaup
This commit is contained in:
parent
b6fcbac030
commit
659c499bd0
4 changed files with 15 additions and 5 deletions
|
@ -3,10 +3,15 @@ using Stylet;
|
||||||
|
|
||||||
namespace DiscordChatExporter.Gui.ViewModels.Components
|
namespace DiscordChatExporter.Gui.ViewModels.Components
|
||||||
{
|
{
|
||||||
public class ChannelViewModel : PropertyChangedBase
|
public partial class ChannelViewModel : PropertyChangedBase
|
||||||
{
|
{
|
||||||
public Channel Model { get; set; }
|
public Channel Model { get; set; }
|
||||||
|
|
||||||
public string Category { get; set; }
|
public string Category { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public partial class ChannelViewModel
|
||||||
|
{
|
||||||
|
public static implicit operator Channel(ChannelViewModel viewModel) => viewModel.Model;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -4,10 +4,15 @@ using Stylet;
|
||||||
|
|
||||||
namespace DiscordChatExporter.Gui.ViewModels.Components
|
namespace DiscordChatExporter.Gui.ViewModels.Components
|
||||||
{
|
{
|
||||||
public class GuildViewModel : PropertyChangedBase
|
public partial class GuildViewModel : PropertyChangedBase
|
||||||
{
|
{
|
||||||
public Guild Model { get; set; }
|
public Guild Model { get; set; }
|
||||||
|
|
||||||
public IReadOnlyList<ChannelViewModel> Channels { get; set; }
|
public IReadOnlyList<ChannelViewModel> Channels { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public partial class GuildViewModel
|
||||||
|
{
|
||||||
|
public static implicit operator Guild(GuildViewModel viewModel) => viewModel.Model;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -60,7 +60,7 @@ namespace DiscordChatExporter.Gui.ViewModels.Dialogs
|
||||||
To = From;
|
To = From;
|
||||||
|
|
||||||
// Generate default file name
|
// Generate default file name
|
||||||
var defaultFileName = ExportHelper.GetDefaultExportFileName(SelectedFormat, Guild.Model, Channel.Model, From, To);
|
var defaultFileName = ExportHelper.GetDefaultExportFileName(SelectedFormat, Guild, Channel, From, To);
|
||||||
|
|
||||||
// Prompt for output file path
|
// Prompt for output file path
|
||||||
var ext = SelectedFormat.GetFileExtension();
|
var ext = SelectedFormat.GetFileExtension();
|
||||||
|
|
|
@ -260,8 +260,8 @@ namespace DiscordChatExporter.Gui.ViewModels
|
||||||
var progressHandler = new Progress<double>(p => Progress = p);
|
var progressHandler = new Progress<double>(p => Progress = p);
|
||||||
|
|
||||||
// Get chat log
|
// Get chat log
|
||||||
var chatLog = await _dataService.GetChatLogAsync(token, dialog.Guild.Model, dialog.Channel.Model,
|
var chatLog = await _dataService.GetChatLogAsync(token, dialog.Guild, dialog.Channel, dialog.From,
|
||||||
dialog.From, dialog.To, progressHandler);
|
dialog.To, progressHandler);
|
||||||
|
|
||||||
// Export
|
// Export
|
||||||
_exportService.ExportChatLog(chatLog, dialog.FilePath, dialog.SelectedFormat,
|
_exportService.ExportChatLog(chatLog, dialog.FilePath, dialog.SelectedFormat,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue