table of contents
PYTAGSFS(1) | [FIXME: manual] | PYTAGSFS(1) |
NAME¶
pytagsfs - filesystem mapping media files to an arbitrary directory structure
SYNOPSIS¶
pytagsfs [OPTIONS] {sourcedir} {mountpoint}
DESCRIPTION¶
pytagsfs is a FUSE filesystem that was designed to present multiple views of tagged media files. For instance, a directory tree containing audio files could be mapped to a new directory structure organizing those same files by album, genre, release date, etc.
To get a feel for what's possible, see the section called “EXAMPLES”.
Log messages are kept in a limited-size ring buffer in memory, and can be read from the virtual file named ".log", under the mount point root.
OPTIONS¶
--version
-h, --help
-f
-d
-s
-r
-o opt[,opt...]
-o format=FORMAT
-o srcfilter=EXPR
-o dstfilter=EXPR
-o iocharset=ENCODING
-o source_iocharset=ENCODING
-o ro
-o rdonly
-o allow_other
-o allow_root
-o nonempty
-o uid=UID
-o gid=GID
-o verbosity=VERBOSITY
-o logsize=LOGSIZE
-o debug
-o force_write_support
FORMAT STRINGS¶
A format string must be specified for each pytagsfs mount. The format string specifies the structure of the virtual filesystem mount by defining a template for virtual paths. For instance, the following format string defines a virtual filesystem layout that organizes media files by artist, then by album, and, finally, by track name:
/%{artist}/%{album}/%{track}.%{extension}
Substitutions¶
The format string should contain zero or more substitution sequences. Each such sequence begins with a percent sign (%).
Substitution sequences may be specified in either long or short forms. Long-form substitution sequences are written as "%{KEY}", where KEY corresponds with a meta-data key. The set of available keys varies from file to file, however, many media files feature some or all of the following long keys:
Short-form substitution sequences are written as "%X". Each such sequence is an abbreviation for a long-form sequence, as indicated below:
Modifiers¶
Format strings can be further extended to perform string translations on parameters prior to substitution. Such translations are indicated by the inclusion of a modifier character after the percent sign. For instance, "%^a" indicates an all-caps version of the artist name, as does "%^{artist}".
The full list of modifier characters follows:
Conditional Expressions¶
Normally, any file for which a parameter required by the format string cannot be determined is implicitly excluded from the resulting filesystem. Conditionals can be used to express that these files should be included, but that those portions of the format string that cannot be rendered should be omitted or replaced.
Two types of conditional expressions may be used: "if" expressions and "if-else" expressions. The contents of an "if" expression are omitted unless all parameters within that expressions can be successfully evaluated. An "if-else" expression is similar, except that, if the expression does not evaluate, an alternative will be used instead. Use the following syntax:
PATH FILTERS¶
Path filters can be used to limit the set of files presented by the filesystem using regular expressions. Files are filtered by source path or by destination path, inclusively (limiting the set of paths to those that match the regular expression) or exclusively (limiting the set of paths to those that do not match the regular expression).
Use the mount options srcfilter and dstfilter to filter by source path and destination path, respectively. Filters are inclusive unless the filter parameter starts with an exclamation point, in which case the regular expression is assumed to be the part of the parameter following the exclamation point.
Multiple filters of any kind may be used, and are applied in the order that they are specified on the command line. See the section called “EXAMPLES” for some sample filters.
EXAMPLES¶
View media files in src, with original filenames in a flat directory structure:
$ pytagsfs -o format='/%f' src mnt
View media files in src by album on mnt:
$ pytagsfs -o format='/%a/%f' src mnt
A more complex album-based view:
$ pytagsfs -o format='/%a - %l/%N %a - %t [%l].%e'
This is like above, but filters the result. I use this to display my files by album, but exclude compilations (which I've tagged to include a hyphen in the album name, like "various - album"):
$ pytagsfs -o \
format='/%a - %l/%N %a - %t [%l].%e',\
dstfilter='!^/[^/]* - [^/]* - [^/]*/' \
src albums
I use this to display the compilations:
$ pytagsfs -o \
format='/%l/%N %a - %t [%l].%e',\
dstfilter='^/[^/]* - [^/]*/' \
src compilations
Maybe you only want to see files that start with "a" and end in ".mp3"?
$ pytagsfs -o \
format='/%f',dstfilter='^/a',dstfilter='\.mp3$' \
src mnt
UNMOUNTING¶
To unmount the filesystem on Linux use fusermount(1):
$ fusermount -u mnt
To unmount the filesystem on OS X or *BSD use umount(1):
$ umount mnt
BUGS¶
Please report bugs on launchpad at http://launchpad.net/products/pytagsfs/+bugs.
SEE ALSO¶
fusermount(1), mount(8), umount(8), pytags(1)
AUTHOR¶
Forest Bond
COPYRIGHT¶
Copyright © 2007, 2008, 2009
2009-12-14 | [FIXME: source] |