mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2024-09-19 20:28:46 -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
|
||||
{
|
||||
public class ChannelViewModel : PropertyChangedBase
|
||||
public partial class ChannelViewModel : PropertyChangedBase
|
||||
{
|
||||
public Channel Model { 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
|
||||
{
|
||||
public class GuildViewModel : PropertyChangedBase
|
||||
public partial class GuildViewModel : PropertyChangedBase
|
||||
{
|
||||
public Guild Model { 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;
|
||||
|
||||
// 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
|
||||
var ext = SelectedFormat.GetFileExtension();
|
||||
|
|
|
@ -260,8 +260,8 @@ namespace DiscordChatExporter.Gui.ViewModels
|
|||
var progressHandler = new Progress<double>(p => Progress = p);
|
||||
|
||||
// Get chat log
|
||||
var chatLog = await _dataService.GetChatLogAsync(token, dialog.Guild.Model, dialog.Channel.Model,
|
||||
dialog.From, dialog.To, progressHandler);
|
||||
var chatLog = await _dataService.GetChatLogAsync(token, dialog.Guild, dialog.Channel, dialog.From,
|
||||
dialog.To, progressHandler);
|
||||
|
||||
// Export
|
||||
_exportService.ExportChatLog(chatLog, dialog.FilePath, dialog.SelectedFormat,
|
||||
|
|
Loading…
Reference in a new issue