-
Notifications
You must be signed in to change notification settings - Fork 22
Support for inbox-level settings and Aisauce #262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release/2.0.0
Are you sure you want to change the base?
Conversation
pSpitzner
commented
Jan 9, 2026
- Adds aisauce plugin as a default dependency.
- Adds basic support to configure settings on a per-inbox level. This has great potential to wreak havoc, causing inconsistent libraries if the wrong settings are altered. The focus are plugins. To avoid user errors, config parts that can be altered have to be manually coded into the schema.
|
Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry. |
|
Locally Next steps:
|
| aisauce: PluginAiSauceSchema = field(default_factory=lambda: PluginAiSauceSchema()) | ||
| # Note: we currently set the defaults from the schema in commit_to_beets. | ||
| # This prevents us from using None as default value in beets root-level entries. | ||
| # For instance `aisauce: PluginAiSauceSchema | None = None` wont work, we need |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reconsidering, I think we need to solve this, otherwise we will regret it later.
If we do not find a way to allow using None as the default value for a plugin section at root level (meaning "I dont care about it in the global settings"), we will not be able to allow overrides later while also having the typing.
Edit: with latest eyconf we can now pass Nones, and get through our own validation steps, so thats good.
However, problem remains in beets plugin loading logic:
beets-flask-dev | File "/repo/backend/beets_flask/config/beets_config.py", line 132, in commit_to_beets
beets-flask-dev | load_plugins()
beets-flask-dev | File "/repo/backend/.venv/lib/python3.12/site-packages/beets/plugins.py", line 488, in load_plugins
beets-flask-dev | send("pluginload")
beets-flask-dev | File "/repo/backend/.venv/lib/python3.12/site-packages/beets/plugins.py", line 648, in send
beets-flask-dev | if (r := handler(**arguments)) is not None
beets-flask-dev | ^^^^^^^^^^^^^^^^^^^^
beets-flask-dev | File "/repo/backend/.venv/lib/python3.12/site-packages/beets/plugins.py", line 329, in wrapper
beets-flask-dev | return func(*args, **kwargs)
beets-flask-dev | ^^^^^^^^^^^^^^^^^^^^^
beets-flask-dev | File "/repo/backend/.venv/lib/python3.12/site-packages/beets/plugins.py", line 255, in _verify_config
beets-flask-dev | or "source_weight" not in self.config
beets-flask-dev | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
beets-flask-dev | File "/repo/backend/.venv/lib/python3.12/site-packages/confuse/core.py", line 148, in __contains__
beets-flask-dev | return self[key].exists()
beets-flask-dev | ^^^^^^^^^^^^^^^^^^
beets-flask-dev | File "/repo/backend/.venv/lib/python3.12/site-packages/confuse/core.py", line 87, in exists
beets-flask-dev | self.first()
beets-flask-dev | File "/repo/backend/.venv/lib/python3.12/site-packages/confuse/core.py", line 79, in first
beets-flask-dev | return util.iter_first(pairs)
beets-flask-dev | ^^^^^^^^^^^^^^^^^^^^^^
beets-flask-dev | File "/repo/backend/.venv/lib/python3.12/site-packages/confuse/util.py", line 21, in iter_first
beets-flask-dev | return next(it)
beets-flask-dev | ^^^^^^^^
beets-flask-dev | File "/repo/backend/.venv/lib/python3.12/site-packages/confuse/core.py", line 459, in resolve
beets-flask-dev | raise ConfigTypeError(
beets-flask-dev | confuse.exceptions.ConfigTypeError: aisauce must be a collection, not NoneType
Options:
- Try to set the section in beets config to
{}instead of None, but might need deep nesting, and will likely not solve the issue, once plugins realize a key is missing (like aisauces providers) - pop None sections before putting them into beets. ugly but sensible.
Added config validation for unique paths in configured inbox folders.