projects
/
id3fs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7009392
)
fix filter, even though its still disabled. List special dirs last as an optimisation...
author
Ian Beckwith
<ianb@erislabs.net>
Sun, 17 Oct 2010 03:41:12 +0000
(
04:41
+0100)
committer
Ian Beckwith
<ianb@erislabs.net>
Sun, 17 Oct 2010 03:41:12 +0000
(
04:41
+0100)
lib/ID3FS/Path.pm
patch
|
blob
|
history
diff --git
a/lib/ID3FS/Path.pm
b/lib/ID3FS/Path.pm
index
60b628f
..
9020f44
100644
(file)
--- a/
lib/ID3FS/Path.pm
+++ b/
lib/ID3FS/Path.pm
@@
-82,7
+82,7
@@
sub dirents
# print "DIRENTS: FILE: $self->{path}\n";
if($state==$STATE_ALL)
{
# 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)
{
}
elsif($state==$STATE_TAG || $state==$STATE_TAGVAL)
{
@@
-96,11
+96,12
@@
sub dirents
}
else
{
}
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)
{
}
}
elsif($state==$STATE_BOOLEAN)
{
+ @dents=$self->tags();
my $parent=$self->tail();
unless(defined($parent) &&
ref($parent) eq "ID3FS::PathElement::Boolean" &&
my $parent=$self->tail();
unless(defined($parent) &&
ref($parent) eq "ID3FS::PathElement::Boolean" &&
@@
-108,15
+109,14
@@
sub dirents
{
push(@dents, "NOT");
}
{
push(@dents, "NOT");
}
- push(@dents, $self->tags());
}
elsif($state==$STATE_ROOT)
{
}
elsif($state==$STATE_ROOT)
{
- @dents=(
qw(ALL NOT), $self->tags(
));
+ @dents=(
$self->tags(), qw(ALL NOT
));
}
elsif($state==$STATE_ALBUMS)
{
}
elsif($state==$STATE_ALBUMS)
{
- @dents=($
PATH_ALLTRACKS, $PATH_NOALBUM, $self->albums()
);
+ @dents=($
self->albums(), $PATH_ALLTRACKS, $PATH_NOALBUM
);
}
elsif($state==$STATE_TRACKLIST)
{
}
elsif($state==$STATE_TRACKLIST)
{
@@
-1016,14
+1016,14
@@
sub filter
my $maxdepth=4;
for my $dir (@dirs)
{
my $maxdepth=4;
for my $dir (@dirs)
{
-# print "FILTER (",$self->state(), "): $base / $dir\n";
+# print "
\n
FILTER (",$self->state(), "): $base / $dir\n";
if($self->empty("$base/$dir", $maxdepth))
{
# print "empty: $base / $dir\n";
}
else
{
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);
}
}
push(@outdirs, $dir);
}
}
@@
-1033,7
+1033,7
@@
sub filter
sub empty
{
my($self, $dir, $maxdepth)=@_;
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());
# print "testing($maxdepth): $dir\n";
my $path=ID3FS::Path->new($self->{db}, $dir, $self->{verbose});
# print "PATH INVALID\n" unless($path->isvalid());