handle /NOT/foo/OR/bar
[id3fs.git] / lib / ID3FS / Path.pm
index 89c2e9d..5a5c10e 100644 (file)
@@ -1,3 +1,19 @@
+# id3fs - a FUSE-based filesystem for browsing audio metadata
+# Copyright (C) 2010  Ian Beckwith <ianb@erislabs.net>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
 package ID3FS::Path;
 
 use strict;
@@ -347,6 +363,8 @@ sub parse
     $self->{tagtree}=$self->elements_to_tree(\@elements);
     if($self->{tagtree})
     {
+#      use Data::Dumper;
+#      print Dumper $self->{tagtree};
 #      my ($conditions, @joins)=$self->{tagtree}->to_sql();
 #      print "CONDITIONS(", scalar(@joins), "): ", $conditions, "\n";
     }
@@ -672,7 +690,7 @@ sub filename
        print "FILENAME SQL: $sql\n" if($self->{verbose});
        my ($path, $name)=$self->{db}->cmd_onerow($sql, $id);
        my $id3fs_path=join('/', map { $_->{name}; }  @{$self->{elements}});
-       return($self->{db}->relativise($path, $name, $mountpoint));
+       return($self->{db}->relativise($path, $name, $mountpoint, $self->{path}));
     }
     # should never happen
     return "ERROR";