From 54ed31a3d744b6d5f087393c0216de11fcad2e21 Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Sat, 27 Jan 2024 21:40:05 -0500 Subject: [PATCH] Oops --- TwitchDownloaderCore/Chat/ChatJson.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/TwitchDownloaderCore/Chat/ChatJson.cs b/TwitchDownloaderCore/Chat/ChatJson.cs index 065ce51d..b4b6ccd6 100644 --- a/TwitchDownloaderCore/Chat/ChatJson.cs +++ b/TwitchDownloaderCore/Chat/ChatJson.cs @@ -182,11 +182,14 @@ private static async Task UpgradeChatJson(ChatRoot chatRoot) chatRoot.video ??= new Video { start = (int)Math.Floor(firstComment?.content_offset_seconds ?? 0), - end = (int)Math.Ceiling(lastComment?.content_offset_seconds ?? MAX_STREAM_LENGTH), - id = firstComment?.content_id, - created_at = firstComment?.created_at - TimeSpan.FromSeconds(firstComment?.content_offset_seconds ?? 0) ?? default + end = (int)Math.Ceiling(lastComment?.content_offset_seconds ?? MAX_STREAM_LENGTH) }; + chatRoot.video.id ??= firstComment?.content_id; + + if (chatRoot.video.created_at == default) + chatRoot.video.created_at = firstComment?.created_at - TimeSpan.FromSeconds(firstComment?.content_offset_seconds ?? 0) ?? default; + if (chatRoot.streamer is null) { var broadcaster = new Lazy(() =>