From f7ef3bbb44ed812972e60924f8196f5940e84eda Mon Sep 17 00:00:00 2001 From: Alexey Golub Date: Fri, 26 Jan 2018 18:13:25 +0200 Subject: [PATCH] Bump framework version and small cleanup --- DiscordChatExporter.Cli/DiscordChatExporter.Cli.csproj | 2 +- DiscordChatExporter.Cli/ViewModels/MainViewModel.cs | 2 +- DiscordChatExporter.Core/DiscordChatExporter.Core.csproj | 2 +- DiscordChatExporter.Core/Models/User.cs | 7 +++++-- DiscordChatExporter.Gui/ViewModels/ExportSetupViewModel.cs | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/DiscordChatExporter.Cli/DiscordChatExporter.Cli.csproj b/DiscordChatExporter.Cli/DiscordChatExporter.Cli.csproj index 00fd470..9b5c780 100644 --- a/DiscordChatExporter.Cli/DiscordChatExporter.Cli.csproj +++ b/DiscordChatExporter.Cli/DiscordChatExporter.Cli.csproj @@ -2,7 +2,7 @@ Exe - net45 + net461 2.3 Tyrrrz Copyright (c) 2017-2018 Alexey Golub diff --git a/DiscordChatExporter.Cli/ViewModels/MainViewModel.cs b/DiscordChatExporter.Cli/ViewModels/MainViewModel.cs index 715261e..460622e 100644 --- a/DiscordChatExporter.Cli/ViewModels/MainViewModel.cs +++ b/DiscordChatExporter.Cli/ViewModels/MainViewModel.cs @@ -33,7 +33,7 @@ namespace DiscordChatExporter.Cli.ViewModels // Generate file path if not set if (filePath.IsBlank()) { - filePath = $"{guild} - {channel}.{format.GetFileExtension()}" + filePath = $"{guild.Name} - {channel.Name}.{format.GetFileExtension()}" .Replace(Path.GetInvalidFileNameChars(), '_'); } diff --git a/DiscordChatExporter.Core/DiscordChatExporter.Core.csproj b/DiscordChatExporter.Core/DiscordChatExporter.Core.csproj index 75b697b..748867e 100644 --- a/DiscordChatExporter.Core/DiscordChatExporter.Core.csproj +++ b/DiscordChatExporter.Core/DiscordChatExporter.Core.csproj @@ -1,7 +1,7 @@  - net45 + net461 diff --git a/DiscordChatExporter.Core/Models/User.cs b/DiscordChatExporter.Core/Models/User.cs index a0797ed..25591e9 100644 --- a/DiscordChatExporter.Core/Models/User.cs +++ b/DiscordChatExporter.Core/Models/User.cs @@ -1,4 +1,5 @@ -using Tyrrrz.Extensions; +using System.Globalization; +using Tyrrrz.Extensions; namespace DiscordChatExporter.Core.Models { @@ -14,9 +15,11 @@ namespace DiscordChatExporter.Core.Models public string AvatarHash { get; } + public string DefaultAvatarHash => (Discriminator % 5).ToString(CultureInfo.InvariantCulture); + public string AvatarUrl => AvatarHash.IsNotBlank() ? $"https://cdn.discordapp.com/avatars/{Id}/{AvatarHash}.png" - : $"https://cdn.discordapp.com/embed/avatars/{Discriminator % 5}.png"; + : $"https://cdn.discordapp.com/embed/avatars/{DefaultAvatarHash}.png"; public User(string id, int discriminator, string name, string avatarHash) { diff --git a/DiscordChatExporter.Gui/ViewModels/ExportSetupViewModel.cs b/DiscordChatExporter.Gui/ViewModels/ExportSetupViewModel.cs index 2441787..7bab525 100644 --- a/DiscordChatExporter.Gui/ViewModels/ExportSetupViewModel.cs +++ b/DiscordChatExporter.Gui/ViewModels/ExportSetupViewModel.cs @@ -81,7 +81,7 @@ namespace DiscordChatExporter.Gui.ViewModels Guild = m.Guild; Channel = m.Channel; SelectedFormat = _settingsService.LastExportFormat; - FilePath = $"{Guild} - {Channel}.{SelectedFormat.GetFileExtension()}" + FilePath = $"{Guild.Name} - {Channel.Name}.{SelectedFormat.GetFileExtension()}" .Replace(Path.GetInvalidFileNameChars(), '_'); From = null; To = null;