incomplete support for filtering directories by whether they actually have contents
[id3fs.git] / lib / ID3FS / Path.pm
index 4898aeb..5555bb2 100644 (file)
@@ -69,6 +69,7 @@ sub dirents
 {
     my($self)=@_;
     my @dents=();
+    my @fents=();
     my $state=$self->state();
 #    print "DIRENTS: STATE: $state\n";
 #    print "DIRENTS: FILE: $self->{path}\n";
@@ -112,13 +113,13 @@ sub dirents
     }
     elsif($state==$STATE_TRACKLIST)
     {
-       @dents=$self->tracks();
+       @fents=$self->tracks();
     }
     else
     {
        print "DIRENTS: UNHANDLED STATE: $state\n";
     }
-    return(@dents);
+    return(\@dents, \@fents);
 }
 
 sub parse
@@ -335,7 +336,6 @@ sub parse
        }
     }
 
-    print "ROOT_NOT: $root_not TAGS_SEEN: $tags_seen\n";
     if($root_not && ($tags_seen < 2))
     {
        $self->{bare_not}=1;
@@ -485,7 +485,7 @@ sub tail_parent
 sub tags
 {
     my($self)=@_;
-    if(!$self->{tagtree}) # / or /NOT
+    if(!$self->{tagtree}) # / or /NOT  # FIXME: /ALL too?
     {
        my $sql="SELECT DISTINCT name FROM tags WHERE parents_id='';";
        return($self->{db}->cmd_firstcol($sql));
@@ -754,6 +754,7 @@ sub filename
 sub tags_subselect
 {
     my($self)=@_;
+    my $hasvals=$self->tag_has_values();
     # we need to specially handle a bare /NOT/tag with no other clauses,
     # using a simple WHERE id !='tagid' instead of a LEFT JOIN
     if($self->{bare_not})
@@ -765,7 +766,6 @@ sub tags_subselect
        return "\tSELECT id FROM files AS files_id\n";
     }
     my $tree=$self->{tagtree};
-    my $hasvals=$self->tag_has_values();
     my $parent=$self->trailing_tag_parent();
 
 #    print "ELEMENTS: ", join('/', map { $_->{name}; } @{$self->{elements}}), "\n";