projects
/
id3fs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
da58515
)
artists_albums: use tag constraints
author
Ian Beckwith
<ianb@erislabs.net>
Sat, 2 Oct 2010 18:55:45 +0000
(19:55 +0100)
committer
Ian Beckwith
<ianb@erislabs.net>
Sat, 2 Oct 2010 18:55:45 +0000
(19:55 +0100)
lib/ID3FS/DB.pm
patch
|
blob
|
history
diff --git
a/lib/ID3FS/DB.pm
b/lib/ID3FS/DB.pm
index
0ed658c
..
f0ec02a
100644
(file)
--- a/
lib/ID3FS/DB.pm
+++ b/
lib/ID3FS/DB.pm
@@
-258,7
+258,7
@@
sub albums
# FIXME: rework PathElements
if(ref($constraints[$#constraints]) eq "ID3FS::PathElement::Artist")
{
# FIXME: rework PathElements
if(ref($constraints[$#constraints]) eq "ID3FS::PathElement::Artist")
{
- return $self->artist_albums($constraints[$#constraints]->{id});
+ return $self->artist_albums($constraints[$#constraints]->{id}
, @constraints
);
}
my $sql=("SELECT albums.name\n" .
"\tFROM (\n" .
}
my $sql=("SELECT albums.name\n" .
"\tFROM (\n" .
@@
-275,8
+275,11
@@
sub albums
sub artist_albums
{
sub artist_albums
{
- my($self, $artist_id)=@_;
- my $sql=("SELECT albums.name FROM files\n\t" .
+ my($self, $artist_id, @constraints)=@_;
+ my $sql=("SELECT albums.name FROM (\n" .
+ $self->tags_subselect(@constraints) .
+ "\t) AS subselect\n" .
+ "INNER JOIN files ON subselect.files_id=files.id\n" .
"INNER JOIN albums ON albums.id=files.albums_id\n\t" .
"INNER JOIN artists ON artists.id=files.artists_id\n\t" .
"WHERE artists.id=? and albums.name <> ''\n\t" .
"INNER JOIN albums ON albums.id=files.albums_id\n\t" .
"INNER JOIN artists ON artists.id=files.artists_id\n\t" .
"WHERE artists.id=? and albums.name <> ''\n\t" .