This PR adds support for nexttrack keypress in the web plugin.
It uses feature detection for the Media Session API, and then
instantiates a metadata object for the session, and adds the specific
action handler for the nexttrack keypress.
In a plugin, self.data_source currently returns Any instead of str. This
change allows `cached_classproperty` to retain the type returned by the
decorated method.
…file is placed in the command
## Description
see included doc; placing the playlist filename at the end of command
just isn't working for all players
I have this in use with `mpv`
Co-authored-by: cvx35isl <cvx35isl@users.noreply.github.com>
Co-authored-by: J0J0 Todos <2733783+JOJ0@users.noreply.github.com>
This PR introduces a custom Sphinx extension for documenting
configuration values and updates autotagger plugins documentation to use
consistent cross-reference formatting.
The main reason I introduced it is that I found the default `confval`
directive too verbose for our use case.
**Key Changes:**
### New Sphinx Extension (`docs/extensions/conf.py`)
- Added custom `conf` domain and directive for documenting configuration
values
- Provides `.. conf::` directive for defining config options with
default value support
- Adds `:conf:` role for creating cross-references to configuration
values
- Enables standardized documentation format:
```
:conf:`plugins.plugin_name:option_name`
```
### Documentation Updates
- Converted inline configuration references to use `:conf:` role
throughout:
- `docs/changelog.rst`: Updated references to config options across
multiple plugin sections
- Updated configuration documentation format:
- `docs/plugins/discogs.rst`
- `docs/plugins/musicbrainz.rst`
- `docs/plugins/spotify.rst`
- `docs/plugins/deezer.rst`
- Created `docs/plugins/shared_metadata_source_config.rst` for common
metadata source plugin options (`data_source_mismatch_penalty`,
`search_limit`, `source_weight`)
**Benefits:**
- Consistent, cross-referenceable configuration documentation
- Improved navigation between related config options
- Better maintainability through shared documentation snippets
- Enhanced release notes formatting for config references
https://github.com/user-attachments/assets/f7ee29b6-577a-468d-be58-b0aa648f28d0
Create a custom Sphinx extension to document configuration values with
a simplified syntax. It is based on the `confval` but takes less space
when rendered. The extension provides:
- A `conf` directive for documenting individual configuration values
with optional type and default parameters
- A `conf` role for cross-referencing configuration values
- Automatic formatting of default values in the signature
- A custom domain that handles indexing and cross-references
For example, if we have
.. conf:: search_limit
:default: 5
We refer to this configuration option with :conf:`plugins.discogs:search_limit`.
The extension is loaded by adding the docs/extensions directory to the
Python path and registering it in the Sphinx extensions list.
- Refactor and reduce the code required to log and apply the genre.
- Make the output a bit more user-friendly:
- Use str(obj) to log the object using the user configured format_item / format_album values
- Use ui.show_model_changes to show the change in genre with colors
Replace the log_and_pretend decorator with a more robust implementation
using singledispatchmethod. This simplifies the genre application logic
by consolidating logging and processing into dedicated methods.
Key changes:
- Remove log_and_pretend decorator in favor of explicit dispatch
- Add _fetch_and_log_genre method to centralize genre fetching and logging
- Log user-configured full object representation instead of specific
attributes
- Introduce _process singledispatchmethod with type-specific handlers
- Use LibModel type hint for broader compatibility
- Simplify command handler by removing duplicate album/item logic
- Replace manual genre application with try_sync for consistency
- Move item and genre apply to separate helper functions. Have one
function for each to not overcomplicate implementation!
- Use a decorator log_and_pretend that logs and does the right thing
depending on wheter --pretend was passed or not.
- Sets --force (internally) automatically if --pretend is given (this is
a behavirol change needing discussion)
## Description
For non English tracks (Swedish in my case) feat. words might be
something that ftintitle doesn't pick up.
Eg. for the song `Promoe med Afasi - Inflation`
[https://musicbrainz.org/recording/8e236347-61d6-4e11-9980-52f4cc6b905f](https://musicbrainz.org/recording/8e236347-61d6-4e11-9980-52f4cc6b905f)
the word `med` is `feat.` in Swedish.
With this PR you can add what ever word you wish to match as feat. so it
should cover any kind of language.
The config.yaml could look like this:
ftintitle:
custom_feat_words: ["med"]
## To Do
<!--
- If you believe one of below checkpoints is not required for the change
you
are submitting, cross it out and check the box nonetheless to let us
know.
For example: - [x] ~Changelog~
- Regarding the changelog, often it makes sense to add your entry only
once
reviewing is finished. That way you might prevent conflicts from other
PR's in
that file, as well as keep the chance high your description fits with
the
latest revision of your feature/fix.
- Regarding documentation, bugfixes often don't require additions to the
docs.
- Please remove the descriptive sentences in braces from the enumeration
below,
which helps to unclutter your PR description.
-->
- [x] Documentation. (If you've added a new command-line flag, for
example, find the appropriate page under `docs/` to describe it.)
- [x] Changelog. (Add an entry to `docs/changelog.rst` to the bottom of
one of the lists near the top of the document.)
- [x] Tests. (Very much encouraged but not strictly required.)
The recently introduces `data_source_mismatch_penalty` property in the MetadataPlugin
class was not copied in the backwards compatibility layer. This PR
introduces a fixes this such that `cached_properties` are copied to
legacy metadata plugins.
This also includes a test for the expected behavior.
See also [beetcamp
issue](https://github.com/snejus/beetcamp/issues/85#issuecomment-3399273892).
- Modified `_get_plugin` function to use `reversed()` when iterating
through `namespace.__dict__.values()`
- This ensures that we load _the last_ plugin class found in the
namespace.
Fixes#6093