{
if(Cwd::abs_path($path) !~ /^$abs_base/)
{
- print "$me, $path is outside $base, skipping\n";
+ print "$me: $path is outside $base, skipping\n";
}
File::Find::find( {wanted => \&wanted, follow => 1, no_chdir => 1}, $path);
}
my $directories_pruned=$db->prune_directories();
if($files_pruned || $directories_pruned)
{
- print "Removing data from pruned files\n" if $verbose;
+ print "$me: removing data from pruned files\n" if $verbose;
$db->remove_unused();
}
}
{
my $dir=shift;
return unless(opendir(DIR, $dir));
- print "Pruning $dir\n";
my @oldfiles=$db->files_in($dir);
my @newfiles=grep { !/^\.\.?$/; } readdir(DIR);
closedir(DIR);
my $path=shift;
my $ext=($path=~/.*\.(.*)/)[0];
return undef unless($ext);
+ my $me=shift;
$ext=lc($ext);
if($ext eq "mp3")
{
}
else
{
- print("Unknown extension: $ext\n");
+ print("$me: $path: Unknown extension: $ext\n");
return undef;
}
return $self;
{
($pathpart, $filepart) = ($relpath =~ /(.*)\/(.*)/);
}
- my $file=ID3FS::AudioFile->new($path);
+ my $file=ID3FS::AudioFile->new($path, $self->{me});
return unless(defined($file));
my $artist=$file->artist();
my $album=$file->album();
{
my ($self, $dir)=@_;
$dir=~s/^$self->{base}\/?//;
-# print "Munged dir: $dir\n";
my $sql=("SELECT files.name FROM files\n" .
"INNER JOIN paths ON files.paths_id=paths.id\n" .
"WHERE paths.name=?\n");
{
my($path, $id)=@$pathpair;
my $fullpath="$self->{absbase}/$path";
-# print "PRUNING PATH $fullpath: ";
unless(-d $fullpath)
{
push(@ids, $id)