Skip to content

Commit

Permalink
Oops
Browse files Browse the repository at this point in the history
  • Loading branch information
ScrubN committed Jan 28, 2024
1 parent b4b9614 commit 54ed31a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions TwitchDownloaderCore/Chat/ChatJson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Comment>(() =>
Expand Down

0 comments on commit 54ed31a

Please sign in to comment.