projects
/
id3fs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f1d1250
)
allow OR and NOT in the filesystem
author
Ian Beckwith
<ianb@erislabs.net>
Sat, 2 Oct 2010 01:55:31 +0000
(
02:55
+0100)
committer
Ian Beckwith
<ianb@erislabs.net>
Sat, 2 Oct 2010 01:55:31 +0000
(
02:55
+0100)
lib/ID3FS/Path.pm
patch
|
blob
|
history
diff --git
a/lib/ID3FS/Path.pm
b/lib/ID3FS/Path.pm
index
7107ac7
..
ae8d7d7
100644
(file)
--- a/
lib/ID3FS/Path.pm
+++ b/
lib/ID3FS/Path.pm
@@
-79,17
+79,17
@@
sub dirents
}
else
{
}
else
{
- @dents=(qw(AND
ALLTRACKS), # FIXME: NOT and OR
+ @dents=(qw(AND
OR ALLTRACKS),
$self->{db}->artists(@{$self->{elements}}));
}
}
elsif($state==$STATE_BOOLEAN)
{
$self->{db}->artists(@{$self->{elements}}));
}
}
elsif($state==$STATE_BOOLEAN)
{
- @dents=
$self->{db}->tags(@{$self->{elements}}
);
+ @dents=
("NOT", $self->{db}->tags(@{$self->{elements}})
);
}
elsif($state==$STATE_ROOT)
{
}
elsif($state==$STATE_ROOT)
{
- @dents=(
"ALL"
, $self->{db}->tags(@{$self->{elements}}));
+ @dents=(
qw(ALL NOT)
, $self->{db}->tags(@{$self->{elements}}));
}
elsif($state==$STATE_ALBUMS)
{
}
elsif($state==$STATE_ALBUMS)
{
@@
-133,6
+133,10
@@
sub parse
{
$self->state($STATE_TAG);
}
{
$self->state($STATE_TAG);
}
+ elsif($name eq "NOT")
+ {
+ $self->state($STATE_BOOLEAN);
+ }
else
{
$tag=ID3FS::PathElement::Tag->new($self->{db}, $name);
else
{
$tag=ID3FS::PathElement::Tag->new($self->{db}, $name);
@@
-182,11
+186,6
@@
sub parse
$self->state($STATE_BOOLEAN);
# push(@{$self->{elements}}, ID3FS::PathElement::Boolean->new($name));
}
$self->state($STATE_BOOLEAN);
# push(@{$self->{elements}}, ID3FS::PathElement::Boolean->new($name));
}
- elsif($name eq "NOT")
- {
- $self->state($STATE_TAG);
-# push(@{$self->{elements}}, ID3FS::PathElement::Boolean->new($name));
- }
else
{
my $artist=ID3FS::PathElement::Artist->new($self->{db}, $name);
else
{
my $artist=ID3FS::PathElement::Artist->new($self->{db}, $name);
@@
-204,15
+203,22
@@
sub parse
elsif($state==$STATE_BOOLEAN)
{
# print "SM: BOOLEAN: $name\n";
elsif($state==$STATE_BOOLEAN)
{
# print "SM: BOOLEAN: $name\n";
- my $tag=ID3FS::PathElement::Tag->new($self->{db}, $name);
- if($tag)
+ if($name eq "NOT")
{
{
- push(@{$self->{elements}}, $tag);
- $self->state($STATE_TAG);
- }
+ $self->state($STATE_BOOLEAN);
+ }
else
{
else
{
- $self->state($STATE_INVALID);
+ my $tag=ID3FS::PathElement::Tag->new($self->{db}, $name);
+ if($tag)
+ {
+ push(@{$self->{elements}}, $tag);
+ $self->state($STATE_TAG);
+ }
+ else
+ {
+ $self->state($STATE_INVALID);
+ }
}
}
elsif($state==$STATE_ALBUMS)
}
}
elsif($state==$STATE_ALBUMS)