Beets Music Tagger Plugin for Unraid 5.x


Recommended Posts

Hi folks,

 

I've been tinkering with creating a plugin for Beets, the music tagger/organizer.  I've been running a version on my local server for sometime, but never quite got around to making it generic enough that it could be used by others.

 

I'm a bit obsessive about music metadata, usually running everything through Picard, Foobar and mp3tag before I'm happy to include it in my music media share.  Heck, I used to music finger print everything too, but that was when MusicIP was still going strong.  Anyway, I digress.

 

So my main reason for using Beets was that I wanted something lightweight (ie. not headphones) to help me get the media half-way decent and cut out a few of my tagging steps.  Beets has some good plugins, but at the time I first started using it, some of them were less than easy to install and I ended up using a cocktail of other scripts and utils.  Happy to say that's changed and the bundled plugins work really well.

 

This is a work in progress, so I won't promise it's perfect and owing to the nature of beets, unless you're happy at a command line, this plugin isn't for you.  However, all of the important beets config options can be configured from the unraid webgui, so that takes away a bit of the pain.

 

I plan to include a post-processing script just as soon as I've written one. Really simple sab post-processing script also on git repo.  Needs lots of testing.

 

Anyway, please take a look if you're interested.  You can get it from my github page;

 

https://github.com/overbyrn/UnRAID

 

Once installed, check the beets webgui settings page and run it from command line.  eg. 

beet import /mnt/mymusicdownloads/some.music.dir.to.import

 

 

NB: if you are running SimpleFeatures Email Notify Plugin version 1.0.10, you will need to make a simple small change to that plugin as it attempts to "prune" some unused directories.  Unfortunately the prune is a too aggressive and removes a directory belonging to python which is needed when installing beets (or other python packages). 

To fix this, open simpleFeatures.email.notify-1.0.10-noarch-1.plg".  On line 13, change the following from:

<!ENTITY prune "true"><!-- set to "false" to suppress pruning -->

to

<!ENTITY prune "false"><!-- set to "false" to suppress pruning -->

Reboot for the change to take effect.

 

 

Regards,

overbyrn

Link to comment
  • Replies 77
  • Created
  • Last Reply

Top Posters In This Topic

trurl, I'd also recommend MusicBrainz Picard for bulk tagging of unorganised music.  I'd be interested to hear how you get on with Beets, but using Picard may be quicker.  If you've not used Picard, I highly suggest you give it a try.  I've found it to be the single most helpful app for bulk tagging where metadata is missing or file names are meaningless.  Jaikoz is a close second, but I don't like the gui as much.

 

Link to comment

Hi overbyrn,

 

When installing your beets plugin, i get an error:

 

error: invalid Python installation: unable to open /usr/include/python2.6/pyconfig.h (No such file or directory)

 

A bit of googling found a comment about this you yourself made in the simple features topic. I have the latest simple features installed.... Could this be the cause?

 

Many thanks!

Link to comment

Yes, yes it's most likely simplefeatures plugin which for some unknown reason is set by default to "tidy" a few dirs.  Edit your simplefeatures plugin, about 10 lines into the plugin is a setting to clean dirs. It'll be set to "true". Change to false, reboot and this time it won't wipe out the include dir which is needed for python.  If you don't want to reboot just yet, manually install python package from command line in the usual "installpkg /boot/packages/somepackage" way.

 

 

Link to comment

Glad you got it working.  Yeah there's a gcc error during install.  I think one of the python packages does a test for gcc and if found installs a certain way but if not falls back to another.  Pretty sure it can be safely ignored.

Link to comment

Wow, awesome. When I was testing unRAID, I followed some instructions to manually install beets. A bit of a pain, but then again... I *had* planned on using the command-line to organize, right?

 

I ended up going with unRAID as my storage solution, but continued using Picard MusicBrainz on Windows to organize the music. I'll give your plugin a try.

 

my biggest concern is organizing my music the *same* way it is currently organized from Picard. Is there some sort of settings export for Picard or "analyze current and match" option for beets?

Link to comment

It's working great for me, no complaints that arent' related to Beets itself or the environment I'm using it in.

 

I moved all my music out to my Download folder, imported a new album, then imported my old music. I really appreciated having the graphical setup in the Settings.

 

Cheers!

Link to comment
  • 2 weeks later...

Updated plugin to include Chromaprint/Acoustid support for beets.  Hard-coded enabled (no real reason not to), upon import Beets will now music fingerprint each track to help it determine if there is a vaild MusicBrainz match.  Handy for when there is little or no metadata in the source mp3's.

 

Link to comment

I just tried to install this and in the /root/.pip/pip.log I see this

 

Could not find a version that satisfies the requirement beets==dev (from versions: 1.0b15, 1.0b5, 1.0b6,
1.0rc2, 1.1.0-beta.2, 1.0rc1, 1.0b14, 1.0b2, 1.1.0-beta.3, 1.1.0-beta.1, 1.0.0, 1.0b8, 1.0b1, 1.0b12, 1.0
b7, 1.0b9, 1.0b13, 1.0b4, 1.0b10, 1.0b11, 1.0b3, 1.1.0)

No distributions matching the version for beets==dev

Exception information:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/pip-1.3-py2.6.egg/pip/basecommand.py", line 139, in main
    status = self.run(options, args)
  File "/usr/lib/python2.6/site-packages/pip-1.3-py2.6.egg/pip/commands/install.py", line 266, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/usr/lib/python2.6/site-packages/pip-1.3-py2.6.egg/pip/req.py", line 1026, in prepare_files
    url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
  File "/usr/lib/python2.6/site-packages/pip-1.3-py2.6.egg/pip/index.py", line 201, in find_requirement
    raise DistributionNotFound('No distributions matching the version for %s' % req)
DistributionNotFound: No distributions matching the version for beets==dev

 

I don't get an error when I run the /etc/rc.d/rc.beets write_yaml  but I don't get a beets command either.

 

EDIT:

Installed manually after with pip install beets, it works now.

 

-Dave

Link to comment

Tried here, same issue.  Looks like the pip installer is currently having a problem locating the development version of beets.  There's not much I can do as that's down to how pip locates and downloads beets.  The command is still valid according to beets GitHub. 

 

You could try installing the latest stable (1.1.0) as that's not long been released.  Open my plugin, go to line #858 and replace

pip install beets==dev

for

pip install beets

Or issue the same command from command line. 

 

 

Regards,

overbyrn

Link to comment
  • 3 weeks later...

I'm trying to add a cron job to identify properly, tag, rename and move to a defined structure every XX minutes.

 

Anybody can help with a correct script.

 

So far I achieved the go script modification so it weill add the cron job at each reboot. But it seems that I missed on the command.

Link to comment

I just tried to install this and in the /root/.pip/pip.log I see this

 

Could not find a version that satisfies the requirement beets==dev (from versions: 1.0b15, 1.0b5, 1.0b6,
1.0rc2, 1.1.0-beta.2, 1.0rc1, 1.0b14, 1.0b2, 1.1.0-beta.3, 1.1.0-beta.1, 1.0.0, 1.0b8, 1.0b1, 1.0b12, 1.0
b7, 1.0b9, 1.0b13, 1.0b4, 1.0b10, 1.0b11, 1.0b3, 1.1.0)

No distributions matching the version for beets==dev

Exception information:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/pip-1.3-py2.6.egg/pip/basecommand.py", line 139, in main
    status = self.run(options, args)
  File "/usr/lib/python2.6/site-packages/pip-1.3-py2.6.egg/pip/commands/install.py", line 266, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/usr/lib/python2.6/site-packages/pip-1.3-py2.6.egg/pip/req.py", line 1026, in prepare_files
    url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
  File "/usr/lib/python2.6/site-packages/pip-1.3-py2.6.egg/pip/index.py", line 201, in find_requirement
    raise DistributionNotFound('No distributions matching the version for %s' % req)
DistributionNotFound: No distributions matching the version for beets==dev

 

I don't get an error when I run the /etc/rc.d/rc.beets write_yaml  but I don't get a beets command either.

 

EDIT:

Installed manually after with pip install beets, it works now.

 

-Dave

 

I need to look into what the current status is with regard to installing beets.  Originally I had the plugin install the dev branch as that has a ton more plugins.  But recent Git commits to Beets shows the author made some updates to accommodate changes with the PIP installer.  Unfortunately real life has reared its head and is currently overshadowing any opportunity to mess with stuff like this.

 

 

Regards,

overbyrn

Link to comment

Updated plugin to version 1.3

 

Fix: as v1.2.0 of Beets has been released, there is no need to download and install the dev version.  Changed plugin to download non-dev version.  Should fix installation issues.

 

Enhancement: as of Beets v1.2.0, a new plugin Discogs has been included.  This will be used during import / tagging to query Discogs database.  Amended plugin to automatically install and configure this plugin. 

 

Beets now uses Musicbrainz, Discogs and audio fingerprinting during the import / tagging process.

 

Download latest plugin from my github (see sig), overwrite and reboot and/or install from command line using "installplg".

 

 

 

Regards,

overbyrn

Link to comment

Thanks for your brilliantly constructive comment.

 

Thanks it took me a few hours to come up with that one, I'm rather proud of it. ;)

 

When installing the plugin, it installs v2.6 or whatever version it uses of Python, and removes any other version.

In my instance it was v2.7. Which is used by the new Unmenu 1.6.

Link to comment

Thanks for your brilliantly constructive comment.

 

Thanks it took me a few hours to come up with that one, I'm rather proud of it. ;)

 

When installing the plugin, it installs v2.6 or whatever version it uses of Python, and removes any other version.

In my instance it was v2.7. Which is used by the new Unmenu 1.6.

 

And this would be why a plugin manager is needed or some mechanism available to check on existing installed packages and / or compatible packages across multiple plugins and non-native UnRAID tools.

 

The fact is I went with what I knew to be used in a large number of other plugins.  eg. all of those maintained by Influencer where python is a requirement.  Unfortunately, there is no single place to go to find out what non-native Unraid tool or application (plugin, unmenu etc) is using in the way of packages.

 

I'm not a big user of Unmenu, although as a matter of fact I chose to start fresh on my production box just the other day with an empty /boot/packages directory and new install of 1.6 Unmenu.  Like many, my packages dir had swollen over time and I wanted to get it back to just the relevant packages in use for the handful of plugins I run.  Once done and with a fresh install of Unmenu 1.6 out of the way, there is no sign of python 2.7 on my system.  As I say, I'm not a big Umenu user, so happy to be advised, but if Unmenu was dependent on python 2.7, wouldn't there be a copy in my packages dir?

 

 

 

 

 

 

Link to comment

More of a nuisance than anything else, I installed the Python 2.7 package again and it removed the 2.6x version.

Although I hope it does not brake the Beets plugin dependencies.

 

Ok, I had to do it for my own sanity.

 

On a virgin UnRaid rc12 system, (no plugins, no /boot/packages, nothing), I installed unmenu 1.6 as per info in first post of this thread:

http://lime-technology.com/forum/index.php?topic=27051.0

 

Tested unmenu by going to tower:8080.  Seems ok.  About page shows 1.6.  All good so far.

 

Search for signs of python on my system...

 

root@Tower:~# find / -iname "*python*" -print
/boot/packages/python-unmenu-package.conf
/boot/packages/python_cheetah-unmenu-package.conf
/usr/share/mc/syntax/python.syntax
/usr/lib/python2.6
/tmp/unmenu_tmp/python_cheetah-unmenu-package.conf
/tmp/unmenu_tmp/python-unmenu-package.conf

 

Nothing.  Just reference to umenu conf files and some 2.6 code that comes with base UnRAID system.

 

Am I going mad?  Am I missing a step?  Where's the requirement for Python of any version?

 

 

Link to comment
Guest
This topic is now closed to further replies.