drop2beets implementation #138
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Drop2beets requires more dependencies than can be included by just dropping in the plugin file. It also seems pretty usefull as it allows the container to run more as a daemon (moving all incoming files under /downloads).
Description:
Drop2beets is a plugin that allows beet to scan a folder and automatically move any files that come into it to the library. It's got some requirements (i think the package is called watchdog) that doesn't come normally on the container.
I've fixed this on my local version fine (execing into the container and running a pip install), but it would maybe be beneficial to include this plugin in the main container since i believe it is in the "spirit" of containers/services (not the strongest argument but well. it's all i got :) )
I did my best to implement it as best as i can without any major changes. added 1 extra package to the pip install at the start, also added an extra run command to make /downloads exist at runtime (since that is what i've set drop2beet to scan for by default)
I've modified the startup script to only run the plugin if the env var DROP_ENABLED is set (any value).
Unfortunately i did have to rewrite the config file a bit. Drop2beet works best with move enabled as opposed to copy so i did change that. I didn't want to assume what way the project would prefer to "template"/edit these config files on launch depending on the parameters, but i'm willing to implement it so it works just like it did before my changes.
Also this is the first time i've ever made a pull request. I'm doing my best o7
Benefits of this PR and context:
It does not fix a bug, however it does allow users another capability of running the container as a service by itself, automatically letting it import tracks that are placed under /downloads into it's library which i personally deem as beneficial and assume others will aswell.
How Has This Been Tested?
I build the dockerfile using podman, using some trial and error testing with modifying the startup script under
root/etc/s6-overlay/s6-rc.d/svc-beets/run
until i got the plugin to start up only when giving the env var and having it not halt any other parts of the script (web service still starts up)I admit, i don't really understand what
s6-notifyoncheck
does, but adding it stopped the rest of the stuff from proceeding. so i just used a&
sign to start the plugin in the backgroundSource / References:
the link to the drop2beets project: https://github.com/martinkirch/drop2beets/tree/master