Skip to content

Commit

Permalink
Fix being able to download chats before they start/after they end via…
Browse files Browse the repository at this point in the history
… the CLI
  • Loading branch information
ScrubN committed Dec 26, 2024
1 parent 8c4200c commit 5a38931
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions TwitchDownloaderCore/ChatDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ private async Task DownloadAsyncImpl(FileInfo outputFileInfo, FileStream outputF
chatRoot.video.description = videoInfoResponse.data.video.description?.Replace(" \n", "\n").Replace("\n\n", "\n").TrimEnd();
chatRoot.video.title = videoInfoResponse.data.video.title;
chatRoot.video.created_at = videoInfoResponse.data.video.createdAt;
chatRoot.video.start = downloadOptions.TrimBeginning ? downloadOptions.TrimBeginningTime : 0.0;
chatRoot.video.end = downloadOptions.TrimEnding ? downloadOptions.TrimEndingTime : videoInfoResponse.data.video.lengthSeconds;
chatRoot.video.start = downloadOptions.TrimBeginning ? Math.Max(0, downloadOptions.TrimBeginningTime) : 0.0;
chatRoot.video.end = downloadOptions.TrimEnding ? Math.Min(downloadOptions.TrimEndingTime, videoInfoResponse.data.video.lengthSeconds) : videoInfoResponse.data.video.lengthSeconds;
chatRoot.video.length = videoInfoResponse.data.video.lengthSeconds;
chatRoot.video.viewCount = videoInfoResponse.data.video.viewCount;
chatRoot.video.game = videoInfoResponse.data.video.game?.displayName ?? "Unknown";
Expand Down

0 comments on commit 5a38931

Please sign in to comment.