projects
/
id3fs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
573886d
)
PathElement::*: implement id() method
author
Ian Beckwith
<ianb@erislabs.net>
Mon, 18 Oct 2010 06:09:33 +0000
(07:09 +0100)
committer
Ian Beckwith
<ianb@erislabs.net>
Mon, 18 Oct 2010 06:09:33 +0000
(07:09 +0100)
lib/ID3FS/Path.pm
patch
|
blob
|
history
lib/ID3FS/PathElement/Album.pm
patch
|
blob
|
history
lib/ID3FS/PathElement/Artist.pm
patch
|
blob
|
history
lib/ID3FS/PathElement/Boolean.pm
patch
|
blob
|
history
lib/ID3FS/PathElement/File.pm
patch
|
blob
|
history
lib/ID3FS/PathElement/Tag.pm
patch
|
blob
|
history
lib/ID3FS/PathElement/Tagval.pm
patch
|
blob
|
history
diff --git
a/lib/ID3FS/Path.pm
b/lib/ID3FS/Path.pm
index
96fd323
..
919d28a
100644
(file)
--- a/
lib/ID3FS/Path.pm
+++ b/
lib/ID3FS/Path.pm
@@
-88,7
+88,7
@@
sub dirents
elsif($state==$STATE_TAG || $state==$STATE_TAGVAL)
{
if($state==$STATE_TAG && $self->at("tag") &&
elsif($state==$STATE_TAG || $state==$STATE_TAGVAL)
{
if($state==$STATE_TAG && $self->at("tag") &&
- $self->{db}->tag_has_values($self->tail()->
{id}
))
+ $self->{db}->tag_has_values($self->tail()->
id()
))
{
@dents=$self->tags();
}
{
@dents=$self->tags();
}
@@
-189,10
+189,10
@@
sub parse
my $tag=$self->tail();
# print "SM: TAG/TAGVAL($state): $name\n";
if($state==$STATE_TAG && $self->is("tag", $tag) &&
my $tag=$self->tail();
# print "SM: TAG/TAGVAL($state): $name\n";
if($state==$STATE_TAG && $self->is("tag", $tag) &&
- $self->{db}->tag_has_values($tag->
{id}
))
+ $self->{db}->tag_has_values($tag->
id()
))
{
{
-# print "Parsing: parent: $tag->
{id}
\n";
- my $tagval=ID3FS::PathElement::Tag->new($self->{db}, $name, $tag->
{id}
);
+# print "Parsing: parent: $tag->
id()
\n";
+ my $tagval=ID3FS::PathElement::Tag->new($self->{db}, $name, $tag->
id()
);
if(defined($tagval))
{
$self->state($STATE_TAGVAL);
if(defined($tagval))
{
$self->state($STATE_TAGVAL);
@@
-413,7
+413,7
@@
sub sort_elements
if($self->is("tag", $thing))
{
# Handle tag values by dropping parent
if($self->is("tag", $thing))
{
# Handle tag values by dropping parent
- if(@input && $self->is("tag", $input[0])
+ if(@input && $self->is("tag", $input[0])
)
{
$thing=shift @input;
}
{
$thing=shift @input;
}
@@
-451,7
+451,7
@@
sub expecting_values
my $tail=$self->tail();
if($self->is("tag", $tail))
{
my $tail=$self->tail();
if($self->is("tag", $tail))
{
- return($self->{db}->tag_has_values($tail->
{id}
));
+ return($self->{db}->tag_has_values($tail->
id()
));
}
}
}
}
@@
-461,7
+461,7
@@
sub trailing_tag_id
my $tail=$self->tail();
if($self->is("tag", $tail))
{
my $tail=$self->tail();
if($self->is("tag", $tail))
{
- return($tail->
{id}
);
+ return($tail->
id()
);
}
return undef;
}
}
return undef;
}
@@
-613,7
+613,7
@@
sub albums
# FIXME: rework PathElements
if($self->is("artist", $tail))
{
# FIXME: rework PathElements
if($self->is("artist", $tail))
{
- return $self->artist_albums($tail->
{id}
);
+ return $self->artist_albums($tail->
id()
);
}
my $sql=$self->sql_start("albums.name");
$sql .= ("INNER JOIN albums ON files.albums_id=albums.id\n" .
}
my $sql=$self->sql_start("albums.name");
$sql .= ("INNER JOIN albums ON files.albums_id=albums.id\n" .
@@
-674,7
+674,7
@@
sub tracks
my $tail=$self->tail();
if($self->is("artist", $tail))
{
my $tail=$self->tail();
if($self->is("artist", $tail))
{
- return $self->artist_tracks($tail->
{id}
);
+ return $self->artist_tracks($tail->
id()
);
}
elsif($self->is("album", $tail))
{
}
elsif($self->is("album", $tail))
{
@@
-683,9
+683,9
@@
sub tracks
if($self->is("artist", $artist))
{
# should always happen
if($self->is("artist", $artist))
{
# should always happen
- $artist_id=$artist->
{id}
;
+ $artist_id=$artist->
id()
;
}
}
- return $self->album_tracks($artist_id, $tail->
{id}
);
+ return $self->album_tracks($artist_id, $tail->
id()
);
}
my $sql=$self->sql_start("files.name");
$sql .= "INNER JOIN artists ON files.artists_id=artists.id\n";
}
my $sql=$self->sql_start("files.name");
$sql .= "INNER JOIN artists ON files.artists_id=artists.id\n";
@@
-706,7
+706,7
@@
sub filename
my $tail=$self->tail();
if($self->is("file", $tail))
{
my $tail=$self->tail();
if($self->is("file", $tail))
{
- my $id=$tail->
{id}
;
+ my $id=$tail->
id()
;
my $sql=("SELECT paths.name, files.name FROM files\n" .
"INNER JOIN paths ON files.paths_id=paths.id\n" .
"WHERE files.id=?\n" .
my $sql=("SELECT paths.name, files.name FROM files\n" .
"INNER JOIN paths ON files.paths_id=paths.id\n" .
"WHERE files.id=?\n" .
@@
-786,12
+786,12
@@
sub bare_not_subselect
"\t\tWHERE ");
if(scalar(@tags) > 1)
{
"\t\tWHERE ");
if(scalar(@tags) > 1)
{
- $sql .= ("(t1.parents_id='" . $tags[0]->
{id}
. "' AND t1.id='" .
- $tags[1]->
{id}
. "')");
+ $sql .= ("(t1.parents_id='" . $tags[0]->
id()
. "' AND t1.id='" .
+ $tags[1]->
id()
. "')");
}
else
{
}
else
{
- $sql .= ("(t1.parents_id='' AND t1.id='" . $tags[0]->
{id}
. "')");
+ $sql .= ("(t1.parents_id='' AND t1.id='" . $tags[0]->
id()
. "')");
}
$sql .= "\n\t\tGROUP BY fxt1.files_id\n\t)\n";
return($sql);
}
$sql .= "\n\t\tGROUP BY fxt1.files_id\n\t)\n";
return($sql);
@@
-830,18
+830,18
@@
sub constraints_tag_list
if(defined($lasttag))
{
# print "TAGVAL\n";
if(defined($lasttag))
{
# print "TAGVAL\n";
- push(@tags_vals, [$lasttag, $constraint->
{id}]) if defined($constraint->{id}
);
+ push(@tags_vals, [$lasttag, $constraint->
id()]) if defined($constraint->id()
);
$lasttag=undef;
}
$lasttag=undef;
}
- elsif($self->tag_has_values($constraint->
{id}
))
+ elsif($self->tag_has_values($constraint->
id()
))
{
# print "HASVALUES\n";
{
# print "HASVALUES\n";
- $lasttag=$constraint->
{id} if defined($constraint->{id}
);
+ $lasttag=$constraint->
id() if defined($constraint->id()
);
}
else
{
# print "NOVALUES\n";
}
else
{
# print "NOVALUES\n";
- push(@tags, $constraint->
{id}) if(defined($constraint->{id}
));
+ push(@tags, $constraint->
id()) if(defined($constraint->id()
));
}
}
}
}
}
}
diff --git
a/lib/ID3FS/PathElement/Album.pm
b/lib/ID3FS/PathElement/Album.pm
index
9826fd1
..
8eed935
100644
(file)
--- a/
lib/ID3FS/PathElement/Album.pm
+++ b/
lib/ID3FS/PathElement/Album.pm
@@
-18,5
+18,5
@@
sub new
}
sub type { return "album"; }
}
sub type { return "album"; }
-
+sub id { return shift->{id}; }
1;
1;
diff --git
a/lib/ID3FS/PathElement/Artist.pm
b/lib/ID3FS/PathElement/Artist.pm
index
a0bc50b
..
55fde54
100644
(file)
--- a/
lib/ID3FS/PathElement/Artist.pm
+++ b/
lib/ID3FS/PathElement/Artist.pm
@@
-18,5
+18,6
@@
sub new
}
sub type { return "artist"; }
}
sub type { return "artist"; }
+sub id { return shift->{id}; }
1;
1;
diff --git
a/lib/ID3FS/PathElement/Boolean.pm
b/lib/ID3FS/PathElement/Boolean.pm
index
9189cf8
..
cf7ff80
100644
(file)
--- a/
lib/ID3FS/PathElement/Boolean.pm
+++ b/
lib/ID3FS/PathElement/Boolean.pm
@@
-17,5
+17,6
@@
sub new
}
sub type { return "boolean"; }
}
sub type { return "boolean"; }
+sub id { return shift->{id}; }
1;
1;
diff --git
a/lib/ID3FS/PathElement/File.pm
b/lib/ID3FS/PathElement/File.pm
index
7a5a1c7
..
0db80e4
100644
(file)
--- a/
lib/ID3FS/PathElement/File.pm
+++ b/
lib/ID3FS/PathElement/File.pm
@@
-18,5
+18,6
@@
sub new
}
sub type { return "file"; }
}
sub type { return "file"; }
+sub id { return shift->{id}; }
1;
1;
diff --git
a/lib/ID3FS/PathElement/Tag.pm
b/lib/ID3FS/PathElement/Tag.pm
index
19c3378
..
3ddb659
100644
(file)
--- a/
lib/ID3FS/PathElement/Tag.pm
+++ b/
lib/ID3FS/PathElement/Tag.pm
@@
-19,5
+19,6
@@
sub new
}
sub type { return "tag"; }
}
sub type { return "tag"; }
+sub id { return shift->{id}; }
1;
1;
diff --git
a/lib/ID3FS/PathElement/Tagval.pm
b/lib/ID3FS/PathElement/Tagval.pm
index
3b2a77b
..
33ed3f8
100644
(file)
--- a/
lib/ID3FS/PathElement/Tagval.pm
+++ b/
lib/ID3FS/PathElement/Tagval.pm
@@
-18,5
+18,6
@@
sub new
}
sub type { return "tagval"; }
}
sub type { return "tagval"; }
+sub id { return shift->{id}; }
1;
1;