projects
/
id3fs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c59e731
)
tidy code
author
Ian Beckwith
<ianb@erislabs.net>
Sun, 17 Oct 2010 04:56:27 +0000
(
05:56
+0100)
committer
Ian Beckwith
<ianb@erislabs.net>
Sun, 17 Oct 2010 04:56:27 +0000
(
05:56
+0100)
lib/ID3FS/Path.pm
patch
|
blob
|
history
diff --git
a/lib/ID3FS/Path.pm
b/lib/ID3FS/Path.pm
index
60ea5de
..
86f1a00
100644
(file)
--- a/
lib/ID3FS/Path.pm
+++ b/
lib/ID3FS/Path.pm
@@
-443,7
+443,7
@@
sub used_tags
return($self->{tagtree}->used_tags());
}
return($self->{tagtree}->used_tags());
}
-sub
tag_has
_values
+sub
expecting
_values
{
my($self)=@_;
my $tail=$self->tail();
{
my($self)=@_;
my $tail=$self->tail();
@@
-498,7
+498,7
@@
sub tags
my $sql="SELECT DISTINCT name FROM tags WHERE parents_id='';";
return($self->{db}->cmd_firstcol($sql));
}
my $sql="SELECT DISTINCT name FROM tags WHERE parents_id='';";
return($self->{db}->cmd_firstcol($sql));
}
- my $hasvals=$self->
tag_has
_values();
+ my $hasvals=$self->
expecting
_values();
my $parent=$self->trailing_tag_parent();
# print "THASVALS: $hasvals\n";
# print "TPARENT: ", (defined($parent)? $parent : "NO"), "\n";
my $parent=$self->trailing_tag_parent();
# print "THASVALS: $hasvals\n";
# print "TPARENT: ", (defined($parent)? $parent : "NO"), "\n";
@@
-568,16
+568,6
@@
sub tags
return(@tagnames);
}
return(@tagnames);
}
-sub tag_values
-{
- my($self, $tagid)=@_;
- my $sql=("SELECT DISTINCT name FROM tags\n" .
- "WHERE parents_id=?");
- my @tags=$self->{db}->cmd_firstcol($sql, $tagid);
- @tags=map { length($_) ? $_ : "NOVALUE"; } @tags;
- return @tags;
-}
-
sub artists
{
my($self)=@_;
sub artists
{
my($self)=@_;
@@
-762,7
+752,7
@@
sub filename
sub tags_subselect
{
my($self)=@_;
sub tags_subselect
{
my($self)=@_;
- my $hasvals=$self->
tag_has
_values();
+ my $hasvals=$self->
expecting
_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})
# 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})
@@
-962,21
+952,13
@@
sub empty
return 1;
}
return 1;
}
-sub tagname_has_values
-{
- my($self, $name)=@_;
- my $id=$self->{db}->lookup_id("tags", $name);
- return 0 unless($id);
- return $self->{db}->tag_has_values($id);
-
-}
-
sub dir_is_special
{
my($self, $dir)=@_;
sub dir_is_special
{
my($self, $dir)=@_;
- if((grep { $_ eq $dir; }
- qw(AND OR NOT), $PATH_ALLTRACKS, $PATH_NOARTIST, $PATH_NOALBUM) ||
- ($self->tagname_has_values($dir)))
+ my $id=$self->{db}->lookup_id("tags", $dir);
+ if((grep { $_ eq $dir; } (qw(AND OR NOT), $PATH_ALLTRACKS,
+ $PATH_NOARTIST, $PATH_NOALBUM)) ||
+ ($id && $self->{db}->tag_has_values($id)))
{
return 1;
}
{
return 1;
}