query: global "OR" and "relative path" query modifiers to facilitate filesystem-level scripting
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 2.1k
- Avg merge
- 4d 21h
- Merged PRs (30d)
- 31
Description
Another possible feature I've come up with recently. Maybe I'll even implement this one...
It would be nice to have something like global `--or` and `--path` flags to any subcommand which receives a query on the command line. The `--or` flag would change beets' behavior to imply commas between query statements, and `--path` would tell beets to pass each "match-any" query statement through `os.path.abspath()` (probably with some error detection).
All in all, these options would facilitate usage of beets on filesystem level. For example:
- run Midnight Commander
- mark some directories (Insert)
- `beet convert ... --path --or %t`
or something like `find /path/to/library -type f ... -print0 | xargs -0 beet convert --or`.
Even better, this could be used to tag items with custom fields, but `beet modify` doesn't seem to accept modification statements before query statements (something like `beet modify misc=1 /path/to/library/Non-Album`).
Contributor guide
Research direction
Start by tracing how query arguments are parsed for commands such as `beet convert` and `beet modify`, and review the existing comma-based query behavior. Define how global `--or` and `--path` should apply across subcommands, including `os.path.abspath()` errors and modification statements before queries. Done means the behavior is specified and covered for filesystem paths and match-any queries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100