How to run command after album import


#1

I don’t know if this is possible, but I would like to run a command on each folder that gets imported. I know you can run it after everything is done, but for my application, that would take forever.

This is the workflow that I would like to achieve:
beet import > beet tags album > when album is fully moved to destination folder, run command with [path of folder] > repeat

I hope this is possible, and would really appreciate if someone could help.


#2

Hello! Have you seen the hook plugin?
http://beets.readthedocs.io/en/v1.4.7/plugins/hook.html

You can run a command on any beets-internal event, including the album_imported event described here:
http://beets.readthedocs.io/en/v1.4.7/dev/plugins.html#plugin-events


#3

yes I’ve seen that, but I don’t really understand it. can it be used to run a command with the path to the album folder?


#4

Yes! It will take some experimentation to sort out exactly the configuration you want, but the idea behind the plugin is to run commands with parameters from the event. It should be possible to get the album’s path out of the event parameters.