From d4cc2278a36d05bafc35c62c5692767d7c4c9a96 Mon Sep 17 00:00:00 2001 From: Ian Beckwith Date: Sun, 26 Sep 2010 23:34:08 +0100 Subject: [PATCH] filter constraint ids, drop undefs --- lib/ID3FS/DB.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ID3FS/DB.pm b/lib/ID3FS/DB.pm index a523033..8794ca1 100644 --- a/lib/ID3FS/DB.pm +++ b/lib/ID3FS/DB.pm @@ -160,7 +160,7 @@ sub tags my $cid=$constraint->{id}; push(@ids, $cid); } - @ids = map( { "\"$_\""; } @ids) unless($self->{postgres}); + @ids = map( { "\"$_\""; } grep { defined; } @ids) unless($self->{postgres}); my $tagstr=join(", ", @ids); my $sql = ($main_sql_start . $tagstr . $main_sql_mid . $tagstr . @@ -207,7 +207,7 @@ sub artists my $cid=$constraint->{id}; push(@ids, $cid); } - @ids = map( { "\"$_\""; } @ids) unless($self->{postgres}); + @ids = map( { "\"$_\""; } grep { defined; } @ids) unless($self->{postgres}); my $tagstr=join(", ", @ids); my $sql = ($main_sql_start . $tagstr . $main_sql_end); @@ -240,7 +240,7 @@ sub albums my $cid=$constraint->{id}; push(@ids, $cid); } - @ids = map( { "\"$_\""; } @ids) unless($self->{postgres}); + @ids = map( { "\"$_\""; } grep { defined; } @ids) unless($self->{postgres}); my $str=join(", ", @ids); my $sql = ($main_sql_start . $str . $main_sql_end); @@ -330,7 +330,7 @@ sub tracks my $cid=$constraint->{id}; push(@ids, $cid); } - @ids = map( { "\"$_\""; } @ids) unless($self->{postgres}); + @ids = map( { "\"$_\""; } grep { defined; } @ids) unless($self->{postgres}); my $str=join(", ", @ids); my $sql = ($main_sql_start . $str . $main_sql_end); -- 2.11.0