From 8671790ad6f1e314918e0f6fb9b407d7b510918c Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Thu, 21 Mar 2013 18:36:47 +0000 Subject: updating .current file 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] = "

$lines[0]

\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 . "
\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; -- cgit v0.10.2