diff options
-rwxr-xr-x | rhimport-mz | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/rhimport-mz b/rhimport-mz index 7d26830..30dfd48 100755 --- a/rhimport-mz +++ b/rhimport-mz @@ -104,17 +104,20 @@ unless(-e $ZF_NEW_FILE) { sub read_first_line { my ($file) = @_; - my @lines = read_file($file, binmode => ':utf8', err_mode => 'quiet', chomp => 1); + my @lines = read_file($file, binmode => ':utf8', err_mode => 'quiet'); return "" unless ($lines[0]); + + chomp($lines[0]); return $lines[0]; }; sub get_note { my ($file) = @_; my @lines = read_file($file, binmode => ':utf8', err_mode => 'quiet'); + return "" unless ($lines[0]); + chomp($lines[0]); $lines[0] = "<p><strong>$lines[0]</strong></p>\n"; - return "" unless ($lines[0]); return join('',@lines); }; @@ -160,7 +163,8 @@ foreach my $dir (@STATIC_FILES) { } else { print " $dir: adding $file\n (this was the last file!!!!)\n"; } - + $next_files{$dir} = $next_file; + $sum_title = "$sum_title, " . read_first_line("$dir/.sum_title"); $sum_text = $sum_text . "<br />\n" . get_note("$dir/$file" . "_notes"); foreach my $ext ("flac", "wav", "ogg", "mp3") { @@ -212,5 +216,10 @@ if(!$ret) { } unlink($ZF_NEW_FILE); +foreach my $dir (@STATIC_FILES) { + open(my $fhs, '>', "$dir/.current"); + print $fhs $next_files{$dir} if ($next_files{$dir}); + close($fhs); +} exit 0; |