19f7f7a6d5bd5fdf8866904a44b82448732f2294
commit 19f7f7a6d5bd5fdf8866904a44b82448732f2294
Author: spesk1 <spesk@pm.me>
Date: Sun Jun 30 14:30:58 2019 -0400

A few more changes

diff --git a/sanitize_tl.pl b/sanitize_tl.pl
index c94fea9..34001c9 100755
--- a/sanitize_tl.pl
+++ b/sanitize_tl.pl
@@ -15,12 +15,18 @@ my $file = shift(@ARGV);

foreach my $line ( split("\n", `cat $file`) ) {
chomp $line;
- if ( $line =~ m/([0-9]{2}:[0-9]{2})/ ) {
+ if ( $line =~ m/([0-9]{2}:[0-9]{2}|[0-9]{1,2}:[0-9]{2}:[0-9]{2})/ ) {
my $time_code = $1;
$line =~ s/ $time_code//g;
$line = $line . " " . $time_code;
}

+ if ( $line !~ m/^[0-9]{1,2}\./ ) {
+ $line =~ s/^([0-9]{1,2})//g;
+ my $track_number = $1;
+ $line = "$track_number" . "." . "$line";
+ }
+
my $sanitized_line;
open(my $fh, ">>", \$sanitized_line);
my @line_chars = split("",$line);
diff --git a/yt-track-split b/yt-track-split
index d9b3a61..9581dbd 100755
--- a/yt-track-split
+++ b/yt-track-split
@@ -71,6 +71,7 @@ sub get_end_time($$) {
my $end_time;
if ( $next_start_time =~ m/^(.*)\:([0-9]{2})$/ ) {
my $end_time_val = $2 - 1;
+ if ( $end_time_val < 0 ) { $end_time_val = 0; }
if ( length $end_time_val == 1 ) { $end_time_val = "0" . $end_time_val; }
$end_time = $1 . ":" . $end_time_val;
$end_time = prepend_zeros($end_time);