From 8de54ef12d26c2b94ce3854d559b011da2cce611 Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Thu, 21 Mar 2024 14:24:02 -0400 Subject: [PATCH] Add lower clamp to chapters offset --- TwitchDownloaderCore/VideoDownloader.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TwitchDownloaderCore/VideoDownloader.cs b/TwitchDownloaderCore/VideoDownloader.cs index 3eb604c8..a9d6e2c9 100644 --- a/TwitchDownloaderCore/VideoDownloader.cs +++ b/TwitchDownloaderCore/VideoDownloader.cs @@ -93,8 +93,9 @@ public async Task DownloadAsync(CancellationToken cancellationToken) string metadataPath = Path.Combine(downloadFolder, "metadata.txt"); VideoInfo videoInfo = videoInfoResponse.data.video; + var chaptersOffset = downloadOptions.CropBeginning ? downloadOptions.CropBeginningTime : 0; await FfmpegMetadata.SerializeAsync(metadataPath, videoInfo.owner.displayName, downloadOptions.Id.ToString(), videoInfo.title, videoInfo.createdAt, videoInfo.viewCount, - videoInfo.description?.Replace(" \n", "\n").Replace("\n\n", "\n").TrimEnd(), downloadOptions.CropBeginningTime, videoChapterResponse.data.video.moments.edges, cancellationToken); + videoInfo.description?.Replace(" \n", "\n").Replace("\n\n", "\n").TrimEnd(), chaptersOffset, videoChapterResponse.data.video.moments.edges, cancellationToken); var finalizedFileDirectory = Directory.GetParent(Path.GetFullPath(downloadOptions.Filename))!; if (!finalizedFileDirectory.Exists)