X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=sbin%2Fid3fsd;h=b46706ad668480dc0cc08c19b1f9644fdb945aec;hb=a88823c2e87634d9fdad780b4923a839ba7e2d04;hp=96a4f5716f8fe7d3cfc020fe7bdbc66f5edf8aed;hpb=7c549737241ec9dd03289a9710bb352b66e60569;p=id3fs.git diff --git a/sbin/id3fsd b/sbin/id3fsd index 96a4f57..b46706a 100755 --- a/sbin/id3fsd +++ b/sbin/id3fsd @@ -10,16 +10,18 @@ use ID3FS::Fuse; use vars qw($me); $me=($0=~/(?:.*\/)?(.*)/)[0]; +our $VERSION="1.00"; my $verbose=0; my $help=0; my $dbpath=undef; +my $tagdepth=undef; Configure(qw(bundling no_ignore_case)); my $optret=GetOptions( - "verbose|v" => \$verbose, - "quiet|q" => sub { $verbose=0; }, - "help|h" => \$help, - "database|db=s" => \$dbpath, + "verbose|v" => sub { $verbose++; }, + "help|h" => \$help, + "database|f=s" => \$dbpath, + "t|tagdepth=s" => \$tagdepth, ); usage() if(scalar(@ARGV) != 2 || !$optret || $help); @@ -27,65 +29,100 @@ usage() if(scalar(@ARGV) != 2 || !$optret || $help); my $source=shift; my $mountpoint=shift; -my $db=ID3FS::DB->new($me, $dbpath, $source); -my $fuse=ID3FS::Fuse->new($db, $source, $mountpoint, $verbose); +my $db=ID3FS::DB->new($me, $verbose, 0, $dbpath, $source); +exit unless($db); + +my $fuse=ID3FS::Fuse->new($db, $source, $mountpoint, $verbose, $tagdepth); $fuse->run(); sub usage { - die("Usage: $me [-v] [-q] [-h] [--] file...\n". - " -v\tVerbose\n". - " -q\tQuiet (default)\n". - " -h\tThis help\n". - " --\tEnd of options\n"); + die("Usage: $me [-vqh] [-f ] [--] \n". + " -v\t\t\tVerbose (repeat for more verbosity)\n". + " -h\t\t\tThis help\n". + " -f|--database=FILE\tPath to database file\n" . + " --\t\t\tEnd of options\n"); } __END__ =head1 NAME -program - description +id3fsd - FUSE filesystem for browsing id3 tags =head1 SYNOPSIS -B<> [I<-v>] [I<-q>] [I<-h>] [I...] +B [B<-vh>] SI]> [B<-->] I I =head1 DESCRIPTION +id3fsd provides a browsable filesystem of your music files, organised +into sub-directories by id3 tags (or flac/ogg comments). + +An index should first be created with L, then id3fsd +can mount the files in I on the directory I. + +If not explicitly specified (with B<-f>), the index is searched for +at I/B<.id3fs>. + +The resulting filesystem is read-only. Tags appear as directories, +and files appear as symlinks to the actual files in I. + +FIXME: better description, allow_others/fuse.conf, fstab, explain genre tag + =head1 OPTIONS =over 4 =item B<-v> -Enable verbose operation. - -=item B<-q> - -Quiet (no output). This is the default. +Enable verbose operation. Repeat for more verbosity. =item B<-h> Show a short help message. +=item SI> | SI> + +Use database in I. The default is I/B<.id3fs>. + =item B<--> End of options. =back -=head1 FILES +=head1 EXAMPLES -=head1 ENVIRONMENT +To mount an id3fs filesystem which indexes B<~/music/albums> on +B<~/music/tags>: -=head1 DIAGNOSTICS +First create the index: + + id3fs-index -v ~/music/albums + +If you have a large collection of music, this may take some time. + +Then create the mountpoint: + + mkdir ~/music/tags + +and mount the filesystem: + + id3fsd ~/music/albums ~/music/tags + +Then explore the tags in ~/music/tags/ + +FIXME: fstab =head1 BUGS -None known. Please report any found to ianb@erislabs.net +Please report any found to ianb@erislabs.net =head1 SEE ALSO +L, L + =head1 AUTHOR Ian Beckwith