X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2FID3FS%2FPath.pm;h=5d131889d82a5946adbcc144611f124f7585eed4;hb=198047fe7da462f486e7da3a751ecdea8d285750;hp=4cf5fc29575d980319f68fbf6c1455b94a6e4cbf;hpb=9f0b226ddd9f9644c0a64d0b408aa8f50370f8ed;p=id3fs.git diff --git a/lib/ID3FS/Path.pm b/lib/ID3FS/Path.pm index 4cf5fc2..5d13188 100644 --- a/lib/ID3FS/Path.pm +++ b/lib/ID3FS/Path.pm @@ -1,3 +1,19 @@ +# id3fs - a FUSE-based filesystem for browsing audio metadata +# Copyright (C) 2010 Ian Beckwith +# +# 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 . + package ID3FS::Path; use strict; @@ -79,7 +95,7 @@ sub dirents # print "DIRENTS: FILE: $self->{path}\n"; if($state==$STATE_ALL) { - @dents=($PATH_ALLTRACKS, $PATH_NOARTIST, $self->artists()); + @dents=($self->filter($PATH_ALLTRACKS, $PATH_NOARTIST), $self->artists()); } elsif($state==$STATE_TAG || $state==$STATE_TAGVAL) { @@ -94,10 +110,7 @@ sub dirents { @dents=qw(AND OR); } - push(@dents, ($ENABLE_FILTER ? - $self->filter($PATH_ALLTRACKS, $PATH_NOARTIST) : - ($PATH_ALLTRACKS, $PATH_NOARTIST))); - push(@dents, $self->artists()); + push(@dents, $self->filter($PATH_ALLTRACKS, $PATH_NOARTIST), $self->artists()); } } elsif($state==$STATE_BOOLEAN) @@ -116,7 +129,7 @@ sub dirents } elsif($state==$STATE_ALBUMS) { - @dents=($self->filter($PATH_ALLTRACKS, $PATH_NOALBUM), $self->albums()); + @dents=$self->filter($PATH_ALLTRACKS, $PATH_NOALBUM, $self->albums()); } elsif($state==$STATE_TRACKLIST) { @@ -795,6 +808,7 @@ sub constraints_tag_list sub filter { my($self, @dirs)=@_; + return(@dirs) unless($ENABLE_FILTER); my $base=$self->{path}; my @outdirs=(); for my $dir (@dirs)