# print "DIRENTS: FILE: $self->{path}\n";
if($state==$STATE_ALL)
{
- push(@dents, $PATH_ALLTRACKS, $PATH_NOARTIST, $self->artists());
+ @dents=($self->artists(), $PATH_ALLTRACKS, $PATH_NOARTIST);
}
elsif($state==$STATE_TAG || $state==$STATE_TAGVAL)
{
}
else
{
- push(@dents, qw(AND OR), $PATH_ALLTRACKS, $PATH_NOARTIST, $self->artists());
+ @dents=($self->artists(), qw(AND OR), $PATH_ALLTRACKS, $PATH_NOARTIST);
}
}
elsif($state==$STATE_BOOLEAN)
{
+ @dents=$self->tags();
my $parent=$self->tail();
unless(defined($parent) &&
ref($parent) eq "ID3FS::PathElement::Boolean" &&
{
push(@dents, "NOT");
}
- push(@dents, $self->tags());
}
elsif($state==$STATE_ROOT)
{
- @dents=(qw(ALL NOT), $self->tags());
+ @dents=($self->tags(), qw(ALL NOT));
}
elsif($state==$STATE_ALBUMS)
{
- @dents=($PATH_ALLTRACKS, $PATH_NOALBUM, $self->albums());
+ @dents=($self->albums(), $PATH_ALLTRACKS, $PATH_NOALBUM);
}
elsif($state==$STATE_TRACKLIST)
{
my $maxdepth=4;
for my $dir (@dirs)
{
-# print "FILTER (",$self->state(), "): $base / $dir\n";
+# print "\nFILTER (",$self->state(), "): $base / $dir\n";
if($self->empty("$base/$dir", $maxdepth))
{
# print "empty: $base / $dir\n";
}
else
{
-# print "accepting: $base / $dir\n";
+# print "non-empty, accepting: $base / $dir\n";
push(@outdirs, $dir);
}
}
sub empty
{
my($self, $dir, $maxdepth)=@_;
- return 1 unless($maxdepth);
+ return 0 unless($maxdepth);
# print "testing($maxdepth): $dir\n";
my $path=ID3FS::Path->new($self->{db}, $dir, $self->{verbose});
# print "PATH INVALID\n" unless($path->isvalid());