diff --git a/DiscordChatExporter.Core/Discord/Data/Attachment.cs b/DiscordChatExporter.Core/Discord/Data/Attachment.cs index 799b344..d46e52e 100644 --- a/DiscordChatExporter.Core/Discord/Data/Attachment.cs +++ b/DiscordChatExporter.Core/Discord/Data/Attachment.cs @@ -17,18 +17,19 @@ namespace DiscordChatExporter.Core.Discord.Data public string FileName { get; } + public string FileExtension => Path.GetExtension(FileName); + public int? Width { get; } public int? Height { get; } - public bool IsImage => ImageFileExtensions.Contains(Path.GetExtension(FileName)); + public bool IsImage => ImageFileExtensions.Contains(FileExtension); - public bool IsVideo => VideoFileExtensions.Contains(Path.GetExtension(FileName)); + public bool IsVideo => VideoFileExtensions.Contains(FileExtension); - public bool IsAudio => AudioFileExtensions.Contains(Path.GetExtension(FileName)); + public bool IsAudio => AudioFileExtensions.Contains(FileExtension); - public bool IsSpoiler => - (IsImage || IsVideo || IsAudio) && FileName.StartsWith("SPOILER_", StringComparison.Ordinal); + public bool IsSpoiler => FileName.StartsWith("SPOILER_", StringComparison.Ordinal); public FileSize FileSize { get; } diff --git a/DiscordChatExporter.Core/DiscordChatExporter.Core.csproj b/DiscordChatExporter.Core/DiscordChatExporter.Core.csproj index b098924..9651a8f 100644 --- a/DiscordChatExporter.Core/DiscordChatExporter.Core.csproj +++ b/DiscordChatExporter.Core/DiscordChatExporter.Core.csproj @@ -12,10 +12,7 @@ - - - - + \ No newline at end of file diff --git a/DiscordChatExporter.Core/Exporting/Writers/Html/MessageGroupTemplate.cshtml b/DiscordChatExporter.Core/Exporting/Writers/Html/MessageGroupTemplate.cshtml index b4712ef..caf84ce 100644 --- a/DiscordChatExporter.Core/Exporting/Writers/Html/MessageGroupTemplate.cshtml +++ b/DiscordChatExporter.Core/Exporting/Writers/Html/MessageGroupTemplate.cshtml @@ -46,17 +46,17 @@ }
+ @{/* Referenced message */} @if (Model.MessageGroup.Reference is not null) { -
-
+
@if (Model.MessageGroup.ReferencedMessage is not null) { - Avatar + Avatar @referencedUserNick -