- my($self)=@_;
- my $sql=("SELECT tags.name FROM tags\n" .
- "WHERE tags.parents_id=''\n" .
- "GROUP BY tags.name\n");
- my @names=$self->{db}->cmd_firstcol($sql);
- return (@names);
+ my($self, $dir, $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());
+ return 1 unless($path->isvalid());
+ my($subdirs,$subfiles)=$path->dirents();
+# print "SUBDENTS: ", join(", ", @$subdirs, @$subfiles), "\n";
+# print("SUBFILES: ", join(', ', @$subfiles), "\n") if(@$subfiles);
+ return 0 if(@$subfiles);
+ for my $subdir (@$subdirs)
+ {
+# print "SUBSUB $dir/$subdir\n";
+ if(1) #$self->dir_is_special($subdir))
+ {
+ if($self->empty("$dir/$subdir", ($maxdepth-1)))
+ {
+# print "EMPTY: $dir / $subdir\n";
+ }
+ else
+ {
+# print "NONEMPTY: $dir / $subdir\n";
+ return 0;
+ }
+ }
+ else
+ {
+ return 0;
+ }
+# return 0 if($self->nonempty("$dir/$subdir", ($maxdepth-1)));
+ }
+ return 1;