package tracks; use strict; use Globals; use Globals qw(%PLATTERS); use Globals qw(@MUSIC); use Globals qw(@VIDEO); use Globals qw($target); use Globals qw($delim); use Globals qw($bgcolour); sub new { my $self = { mime => "text/html", playlist => openTemplate("search"), artistSearch => 0, count => 0}; # show the logo if this is a new page my $logo; $logo = '' if ($target eq '_top'); $self->{playlist} =~ s/%LOGO%/$logo/; $self->{playlist} =~ s/%BGCOLOUR%/$bgcolour/g; bless ($self); return $self; } sub desc { return "Track Search Results"; } sub header { my $self = shift; $self->{playlist} .= '
    '; } sub track { my $self = shift; my ($folder, $trackartist, $album, $year, $track, $url, $platter) = @_; $self->{count}++; $self->{playlist} .= "
  1. "; #prepare urls $self->{playlist} .= ' "'.makeHTML($track).""
    "; # prepare artist info foreach( ($folder, $trackartist) ) { $self->{playlist} .= "".makeHTML($_)."," if (/.+/); } chop $self->{playlist}; # remove trailing comma if (length $album > 0) { # album $self->{playlist} .= "
    from "; $album =~ s/\(\d{4}\)(\/|$)/$1/; $self->{playlist} .= makeHTML($album).""; if ($year > 0) { $self->{playlist} .= " ($year)" } } $self->{playlist} .= "
     
  2. \n"; } sub dump { my $self = shift; $self->{playlist} =~ s/%SHORTCUTS%//; if ($self->{count} > 0) { my $REPORT = "Found ".$self->{count}." matches."; $self->{playlist} =~ s/%COUNT%/$REPORT/; return $self->{playlist}."

$REPORT"; } else { $self->{playlist} =~ s/%COUNT%/

Sorry, nothing found./; return $self->{playlist}.""; } } return 1;