symmusic: build directory structure from audio tags

Third-party modifications and add-ons, Apps and Clients

Moderator: moderators

symmusic: build directory structure from audio tags

Postby jmeb » Sun Oct 23, 2011 7:11 pm

I'm a big fan of Subsonic using pure file lists for browsing my library. It grants a lot of flexibility. On occasion though I wish it was organized by by artist, genre, album, etc. As such, I built symmusic (https://github.com/jmeb/symmusic). Its a little python widget that (flexibly) builds a directory structure from audio tags in a specified directory. The audio files in the new directory structure are then symbolically linked to their originating file. This way you can have a different directory for each organization (by genre, by artist) without having multiple copies of the data itself. I've only tested this on linux (debian). Hypothetically it should work on OS X as well, but I very much doubt compatibility with windows.

This is basically a much-inferior implementation of pytagsfs http://www.pytagsfs.org. Its a really cool project and is much more than symmusic will ever by. That said it was a bit of a resource hog on my ~100gb music collection. Unlike pytagsfs, once the script of symmusic is run no additional resources (beyond a bit of disk space for the directory structure) are used.

As the code of symmusic shows I'm a complete novice to python and programming. If you have suggestions, ideas, requests, etc, please feel free to branch, fork, or what have you.

I'm sure this could be done via java/jaudiotagger and thereby integrated more closely with subsonic -- I just don't have the skills. Hoping someone may find this to be of use.
jmeb
 
Posts: 13
Joined: Sun Oct 23, 2011 6:58 pm

Re: symmusic: build directory structure from audio tags

Postby BKKKPewsey » Mon Oct 24, 2011 12:22 pm

Nice :) It a shame I cannot test it.
jmeb wrote: but I very much doubt compatibility with windows.

Just a warning I would not recommend even trying this on Windows Home server as symlinks are a very bad idea on that platform.
Evidently they can break your "tombstones" Whatever they may be :?
:mrgreen:
Everyone is entitled to be stupid, Image but some abuse the privilege!

Due to the confusion from too many genres of music, we have decided to put both country music and rap music into the genre of Crap music.
User avatar
BKKKPewsey
 
Posts: 2080
Joined: Mon May 23, 2011 12:16 pm
Location: United Kingdom

Re: symmusic: build directory structure from audio tags

Postby jmeb » Mon Oct 24, 2011 1:22 pm

A very good point. There is really only one line that does the symbolic link-making:
Code: Select all
os.symlink(source,os.path.join(base,name))
. If there is a windows equivalent to this command (make alias etc) it could easily be substituted out. I *think* everything else should be OS-agnostic.
jmeb
 
Posts: 13
Joined: Sun Oct 23, 2011 6:58 pm

Re: symmusic: build directory structure from audio tags

Postby jmeb » Tue Nov 01, 2011 4:19 pm

A heads up that symmusic (https://github.com/jmeb/symmusic ) can now reduce the pollution by compilations of your sorted directories by removing directories that only have a small number of songs. This way artists only on compilations don't show up in your directory tree. The number of songs required is your choice. This dramatically cleaned up my own directories.

EDIT: Added option to symbolically link any album art in original directories into new sorts. It assumes album art is stored as .jpg.

It also now:
* checks for posix compliance
* that your destination is not inside your source
* has an option to remove broken symbolic links and empty directories.
jmeb
 
Posts: 13
Joined: Sun Oct 23, 2011 6:58 pm


Return to Mods, Apps and Clients

Who is online

Users browsing this forum: No registered users and 22 guests