Round up the "call lasted for X minutes" value

pull/1107/head
Tyrrrz 1 year ago
parent 088612a78f
commit 4efa6094dc

@ -1,5 +1,6 @@
@using System
@using System.Collections.Generic
@using System.Globalization
@using System.Linq
@using System.Threading.Tasks
@using DiscordChatExporter.Core.Discord.Data
@ -99,7 +100,7 @@
}
else if (message.Kind == MessageKind.Call)
{
<span>started a call that lasted @(((message.CallEndedTimestamp ?? message.Timestamp) - message.Timestamp).TotalMinutes) minutes</span>
<span>started a call that lasted @(((message.CallEndedTimestamp ?? message.Timestamp) - message.Timestamp).TotalMinutes.ToString("n0", CultureInfo.InvariantCulture)) minutes</span>
}
else if (message.Kind == MessageKind.ChannelNameChange)
{

@ -1,4 +1,5 @@
using System.Linq;
using System.Globalization;
using System.Linq;
using DiscordChatExporter.Core.Discord.Data;
using DiscordChatExporter.Core.Utils.Extensions;
@ -19,7 +20,13 @@ internal static class PlainTextMessageExtensions
: "Removed a recipient.",
MessageKind.Call =>
$"Started a call that lasted {message.CallEndedTimestamp?.Pipe(t => t - message.Timestamp).Pipe(t => (int)t.TotalMinutes) ?? 0} minutes.",
$"Started a call that lasted {
message
.CallEndedTimestamp?
.Pipe(t => t - message.Timestamp)
.Pipe(t => t.TotalMinutes)
.ToString("n0", CultureInfo.InvariantCulture) ?? "0"
} minutes.",
MessageKind.ChannelNameChange =>
!string.IsNullOrWhiteSpace(message.Content)

Loading…
Cancel
Save