X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=songbook%2Fweb%2Fwebchord.cgi;h=48add33e96c271586c10a60425db93cb2287470d;hb=4552e544af4d122043b047e137e1ad2de65835f2;hp=ef2da0552f9fa5db4322b1843428b829ba4cfb2b;hpb=92a2b6e641d8149d6c0fb79b671cdacb4c8686b5;p=clearscm.git diff --git a/songbook/web/webchord.cgi b/songbook/web/webchord.cgi index ef2da05..48add33 100755 --- a/songbook/web/webchord.cgi +++ b/songbook/web/webchord.cgi @@ -26,6 +26,14 @@ my $documentRoot = "/web"; my $debug = param ('debug'); my $infile = param ('chordpro'); +unless (-f $infile) { + $infile = '/opt/clearscm/songbook/Songs/' . $infile; + + unless (-f $infile) { + print "Unable to $infile"; + exit 1; + } # unless +} # unless sub debug ($) { my ($msg) = @_; @@ -63,14 +71,14 @@ sub musicFileExists ($) { debug "ENTER musicFileExists ($song)"; my $title = fileparse ($song, qr/\.pro/); - my $musicfile = "/songbook/Media/$title.mp3"; + my $musicfile = "/opt/clearscm/songbook/Media/$title.mp3"; - if (-r "$documentRoot$musicfile") { + if (-r $musicfile) { debug "Exists!"; return $title; } else { - debug "Could not find $documentRoot$musicfile"; + debug "Could not find $musicfile"; return undef; } # if @@ -203,7 +211,7 @@ END print <<"END";