From afa580ffe0123e021224c37e131abe15512cfe98 Mon Sep 17 00:00:00 2001 From: faissaloo Date: Sat, 23 Jan 2021 18:49:36 +0000 Subject: [PATCH] When cutting don't add chapters if there weren't any before --- src/sponskrub/sponskrub.d | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/sponskrub/sponskrub.d b/src/sponskrub/sponskrub.d index e19dd3c..fd4f247 100644 --- a/src/sponskrub/sponskrub.d +++ b/src/sponskrub/sponskrub.d @@ -163,13 +163,18 @@ Options: } else { writeln("Surgically removing the shilling..."); auto content_times = timestamps_to_keep(new_chapter_times); + auto cut_chapter_times = ""; + + if (input_chapters_count > 0) { + cut_chapter_times = generate_chapters_metadata(calculate_timestamps_for_kept_clips(content_times)); + } ffmpeg_status = run_ffmpeg_filter( input_filename, output_filename, cut_and_cat_clips_filter(content_times, get_file_category(input_filename)), get_file_category(input_filename), - generate_chapters_metadata(calculate_timestamps_for_kept_clips(content_times)) + cut_chapter_times ); }