beetbox / beetbox/beets

Scriptable Beets

Open
#1,077 3 comments 0 reactions 0 assignees View on GitHub
discussion
Dominant language
Python
Stars
15.7k
Forks
2.1k
Avg merge
4d 21h
Merged PRs (30d)
31

Description

While it's true that beets can be extended with modules and plugins, sometimes it's hard to match the flexibility and ease offered by reasonably predictable output and a shell script. This was kicked off by this thread: https://groups.google.com/d/msg/beets-users/riHlzEDzPhE/kPo1GmrHtKMJ

I propose adding a new option to the beet command line (-s, --script, maybe?) that will modify beet's behaviour in three major ways:
- Single threaded execution. It may even be smart to make beets only operate on a single argument or path at a time.
- Verbose output that is easily ingested by other command line tools (grep, sed, etc).
- Exit codes changed up so that testing the exit code is a reliable indicator of whether the script succeeded.

There are a couple of behavioural considerations that I don't have an answer for: Single threaded but accepts multiple argument vs only working on a single input at a time - this might have an impact on how you want to handle stdout. Speaking of output, line buffered output vs buffering the import or the whole script run - need to consider how you'll keep the data in stdout paired with the command being run.

My particular use case involved running a beet import on each new release added to a directory. I only ever have one input argument and thus always know what my output will be concerning. So I don't have a strong opinion about how many arguments --script mode accepts or how the output is buffered. But anyone running bulk operations across large libraries might appreciate a considered solution.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.