X-Git-Url: https://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2FID3FS%2FPath.pm;h=0f3241c3a9efdc3669412501945b23b402b4670c;hb=01c06662c7cc896ded00a11aca1be4690700f31a;hp=ea220652de465c7d654ca1f42b4251cbae7f22d1;hpb=dfa48c6258f1e0db4b1b17719c2ad84065335b90;p=id3fs.git diff --git a/lib/ID3FS/Path.pm b/lib/ID3FS/Path.pm index ea22065..0f3241c 100644 --- a/lib/ID3FS/Path.pm +++ b/lib/ID3FS/Path.pm @@ -416,8 +416,7 @@ sub sort_elements sub used_tags { my($self)=@_; - print "TAGTREE UNDEF\n" unless(defined($self->{tagtree})); - return undef unless(defined($self->{tagtree})); + return() unless(defined($self->{tagtree})); return($self->{tagtree}->used_tags()); } @@ -471,7 +470,7 @@ sub tail_parent sub tags { my($self)=@_; - if(!@{$self->{elements}}) # / + if(!$self->{tagtree}) # / or /NOT { my $sql="SELECT DISTINCT name FROM tags WHERE parents_id='';"; return($self->{db}->cmd_firstcol($sql)); @@ -486,7 +485,7 @@ sub tags ") AS subselect\n" . "INNER JOIN files_x_tags ON subselect.files_id=files_x_tags.files_id\n" . "INNER JOIN tags ON files_x_tags.tags_id=tags.id\n"); - my (@allused)=$self->used_tags(); + my @allused=$self->used_tags(); my @used=grep { ref($_) ne "ARRAY"; } @allused; my @used_with_vals=grep { ref($_) eq "ARRAY"; } @allused; # print "tags(): USED: ", join(", ", @used), "\n"; @@ -722,7 +721,7 @@ sub tags_subselect # print "Trailing id: $tag\n"; } my ($sqlclause, @joins)=(undef, ()); - ($sqlclause, @joins) = $tree->to_sql($tag) if($tree); + ($sqlclause, @joins) = $tree->to_sql() if($tree); # print "SQL(" . scalar(@joins) .": $sqlclause\n"; my $sql="\tSELECT fxt1.files_id FROM tags t1"; my @crosses=();