Fix video attachments getting rendered as images

Fixes #120
pull/162/head
Alexey Golub 6 years ago
parent 69fe8af87a
commit 2dd0742c1c

@ -1,4 +1,5 @@
using ByteSizeLib;
using System;
using ByteSizeLib;
namespace DiscordChatExporter.Core.Models
{
@ -14,10 +15,14 @@ namespace DiscordChatExporter.Core.Models
public int? Height { get; }
public bool IsImage => Width != null;
public string FileName { get; }
public bool IsImage => FileName.EndsWith(".jpg", StringComparison.OrdinalIgnoreCase) ||
FileName.EndsWith(".jpeg", StringComparison.OrdinalIgnoreCase) ||
FileName.EndsWith(".png", StringComparison.OrdinalIgnoreCase) ||
FileName.EndsWith(".gif", StringComparison.OrdinalIgnoreCase) ||
FileName.EndsWith(".bmp", StringComparison.OrdinalIgnoreCase);
public ByteSize FileSize { get; }
public Attachment(string id, int? width, int? height, string url, string fileName, ByteSize fileSize)

Loading…
Cancel
Save