Skip to content

Commit

Permalink
Add lower clamp to chapters offset
Browse files Browse the repository at this point in the history
  • Loading branch information
ScrubN committed Mar 21, 2024
1 parent 79eab7f commit 8de54ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion TwitchDownloaderCore/VideoDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8de54ef

Please sign in to comment.