X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2FID3FS%2FDB.pm;h=d149b6addf31a4b87a8045e6bddfa47d600295fb;hb=718f65e679aed209f98961cbdf655bfed44ca1a4;hp=f45790559c0b0494aafc58df0481e4fdf4dd5b1a;hpb=cf53a5fa299b5a88f238ea0d599c584103869a7c;p=id3fs.git diff --git a/lib/ID3FS/DB.pm b/lib/ID3FS/DB.pm index f457905..d149b6a 100644 --- a/lib/ID3FS/DB.pm +++ b/lib/ID3FS/DB.pm @@ -454,9 +454,15 @@ sub add my $haspic=$file->haspic(); $artist=undef unless($self->ok($artist)); + print "$self->{me}: $path: no artist tag defined\n" unless(defined($artist)); my $artist_id=$self->add_to_table("artists", $artist); my $path_id=$self->add_to_table("paths", $pathpart); $album=undef unless($self->ok($album)); + if($self->{verbose} && !defined($album)) + { + print "$self->{me}: $path: no album tag defined\n"; + } + my $albums_id=$self->add_to_table("albums", $album); my $file_id=$self->add_to_table("files", $filepart, { "artists_id" => $artist_id, @@ -560,7 +566,7 @@ sub files_in { my ($self, $dir)=@_; $dir=~s/^$self->{base}\/?//; - print "Munged dir: $dir\n"; +# 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"); @@ -578,7 +584,7 @@ sub prune_directories { my($path, $id)=@$pathpair; my $fullpath="$self->{absbase}/$path"; - print "PRUNING PATH $fullpath: "; +# print "PRUNING PATH $fullpath: "; unless(-d $fullpath) { push(@ids, $id) @@ -591,6 +597,7 @@ sub prune_directories sub prune_paths { my($self, @ids)=@_; + return unless(@ids); my $sql=("DELETE FROM files WHERE paths_id IN (\n\t" . join(', ', map { "\"$_\""; } @ids). "\n\t)"); print "SQL: \n", $sql, "\n";