Commit 38f85baf authored by Bernhard Geier's avatar Bernhard Geier

only prepend "FM4" to the filename if it's not already there

parent f6277cd3
......@@ -45,12 +45,12 @@ foreach (@{$result->{'hits'}}) {
my @parts=(sort { $a->{'start'} cmp $b->{'start'}} @{$data->{'streams'}}); # for multi-part shows (e.g. "Morning Show") sort them by start time...
for (my $i=0; $i<@parts; $i++) {
my $tagTitle=$title." ".$broadcastDate;
$tagTitle.=" [".($i+1)."/".@parts."]" if @parts>1; # ...and add "[currentPartNo/totalParts]" to title
my $filename="FM4 ".$tagTitle.".mp3";
my $filename=$tagTitle.".mp3";
$filename="FM4 ".$filename unless $filename=~/^FM4/;
my $file=File::Spec->join($DESTDIR,$filename);
if (-f $file) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment