Commit Graph
165 Commits
Author SHA1 Message Date
Šarūnas Nejus 743eb3b36b bpd: fix search when any field is used 2026-08-29 17:49:13 +01:00
Šarūnas Nejus bfe5ba51c5 typing: fix annotations in bpd plugin 2026-08-29 17:49:13 +01:00
Šarūnas Nejus 1ae8778385 typing: add annotations to bpd plugin 2026-08-29 17:38:48 +01:00
Šarūnas Nejus 914441da16 typing: fix command handlers types 2026-08-21 20:56:38 +01:00
Šarūnas Nejus 14eabc6060 typing: add types to command handlers 2026-08-19 23:57:01 +01:00
Šarūnas Nejus d53af83386 Serialize BPD notifications per connection
- Track active notification tasks by connection so repeated dispatches do not
  send duplicate idle responses while a previous send is still draining.
- Add regression coverage for serialized notification delivery and idle command
  disconnect handling.
2026-08-17 05:05:21 +01:00
Šarūnas Nejus 9b16f67af1 Remove bluelet in favor of using asyncio in bpd plugin 2026-08-17 05:05:21 +01:00
Sebastian Mohr 54a2bd20e1 Removed This file is part of beets... headers. 2026-06-29 11:20:15 +02:00
Šarūnas Nejus d53ee774a9 Enable and fix flake8-return 2026-06-09 00:14:06 +01:00
Šarūnas Nejus 5be035f49d Enable and fix flake8-pie 2026-06-09 00:14:06 +01:00
Sebastian Mohr adfb73b66d Run ruff format 2026-05-20 16:53:06 +02:00
Šarūnas Nejus 30ab81eb5b Extract UserError from beets.ui to a new beets.exceptions module.
Update all references in core, plugins, and tests to import UserError
from the new location. This centralizes exception handling and improves
code organization.
2026-05-16 11:18:51 +01:00
Šarūnas Nejus 85eaa447f0 Migrate composer -> composers 2026-04-05 09:15:23 +01:00
Šarūnas Nejus a8d53f78de Fix the rest of the tests 2026-02-27 18:34:26 +00:00
Šarūnas Nejus 5d7fb4e158 Remove genre field 2026-02-27 18:34:26 +00:00
Šarūnas Nejus df1573ce9d Make MusicBrainzAPI logs visible 2026-02-07 22:36:43 +00:00
Šarūnas Nejus 1c20e4bd4e Address RUF012 2026-01-13 20:55:40 +00:00
Šarūnas Nejus c52656fb0a Enable RUF rules 2026-01-13 20:55:40 +00:00
Šarūnas Nejus d486885af3 pyupgrade Python 3.10 2025-11-08 12:09:52 +00:00
Sebastian Mohr 4782e96599 Move vfs.py to beetsplug._utils package to avoid polluting core namespace (#6017)
This PR moves the `vfs.py` module, which is only used by plugins, to
avoid polluting the main beets namespace. Also exposes the `vfs` and
`art` module from beets with a deprecation warning.
2025-10-01 12:28:18 +02:00
Šarūnas Nejus b3d434f58f Delegate attribute access to logging 2025-08-30 23:10:21 +01:00
Šarūnas Nejus d6b6ac3387 Replace logging f-strings with arguments 2025-08-30 23:10:21 +01:00
Šarūnas Nejus 1c16b2b308 Replace string concatenation (' + ')
- Join hardcoded strings
- Replace concatenated variables with f-strings
2025-08-30 23:10:15 +01:00
Šarūnas Nejus 9352a79e41 Replace percent formatting 2025-08-30 22:35:00 +01:00
Šarūnas Nejus 4a361bd501 Replace format calls with f-strings 2025-08-30 18:42:26 +01:00
Šarūnas Nejus a5bbe57490 Fix types in test_player 2025-07-16 14:06:34 +01:00
Šarūnas Nejus 52951bf719 Fix legalize_path types
Background
  The `_legalize_stage` function was causing issues with Mypy due to
  inconsistent type usage between the `path` and `extension` parameters.
  This inconsistency stemmed from the `fragment` parameter influencing the
  types of these variables.

Key issues
  1. `path` was defined as `str`, while `extension` was `bytes`.
  2. Depending on `fragment`, `extension` could be either `str` or `bytes`.
  3. `path` was sometimes converted to `bytes` within `_legalize_stage`.

Item.destination` method
  - The `fragment` parameter determined the output format:
    - `False`: Returned absolute path as bytes (default)
    - `True`: Returned path relative to library directory as str

Thus
  - Rename `fragment` parameter to `relative_to_libdir` for clarity
  - Ensure `Item.destination` returns `bytes` in all cases
  - Code expecting strings now converts the output to `str`
  - Use only `str` type in `_legalize_stage` and `_legalize_path`
    functions
  - These functions are no longer dependent on `relative_to_libdir`
2025-05-04 12:23:22 +01:00
Šarūnas Nejus a8ad7df064 Use Item.field_query for queries that receive user input 2025-01-19 01:09:11 +00:00
Šarūnas Nejus 4650f6513b Add Item.any_writable_media_field_query method for BPD search 2025-01-19 01:09:11 +00:00
Šarūnas Nejus 51f9dd229e Use PEP585 lowercase collections typing annotations 2024-12-10 06:10:03 +00:00
Šarūnas Nejus 5f78d1b82b Remove some lint exclusions and fix the issues
* Replace `noqa` comments in `assert...` method definitions with
  a configuration option to ignore these names.
* Use the `__all__` variable to specify importable items from the
  module, replacing `*` imports and `noqa` comments for unused imports.
* Address issues with poorly named variables and methods by renaming
  them appropriately.
2024-09-21 11:59:19 +01:00
Šarūnas Nejus f36bc497c8 Fix lint issues
- Fix imports
- Fix pytest issues
- Do not assign lambda as variable
- Use isinstance instead of type to check type
- Rename ambiguously named variables
- Name custom errors with Error suffix
2024-09-21 11:59:18 +01:00
Šarūnas Nejus 85a17ee503 Reformat the codebase 2024-09-21 11:57:48 +01:00
Šarūnas Nejus 2800a323a2 Revert "Make queries fast, filter all flexible attributes (#5240)"
This reverts commit 143b9202f3, reversing
changes made to 8508a57d77.
2024-06-19 21:51:44 +01:00
Šarūnas Nejus 1f93207823 Add any_writable_field_query to fix bpd search 2024-06-16 15:28:46 +01:00
Arav K. d3bdf137ea Resolve some 'mypy' errors 2024-06-12 15:58:00 +02:00
Serene-Arc a6e5201ff3 Apply formatting tools to all files
This is 'the big one', which touches every file so that it all conforms
to the given standard.
2023-10-22 09:53:18 +10:00
Adrian Sampson c5e68f5643 Adapt to pycodestyle changes 2022-07-30 19:54:24 -04:00
Andrew Rogl ee4268dabb Remove unused imports
Fix imports
Fix formatting
2021-08-26 20:59:48 +10:00
Andrew Rogl 1ec87a3bdd pyupgrade beetsplug and tests
All tests working
More tidy up to be done
2021-08-26 19:12:51 +10:00
Adrian Sampson 75c41c0546 Remove most six.PY2 checks 2021-08-19 16:45:11 -04:00
Aksh Gupta 79858975a9 chore: refactor code quality issues 2021-03-11 08:45:42 +05:30
Aidan Epstein 9c479659b2 Increment playlist_version when a track is consumed.
This fixes the playlist not updating when in consume mode, at least in
ncmpcpp.
2019-11-24 19:27:09 -08:00
Carl Suster 62aa358ce7 bpd: bump protocol version to 0.16 2019-06-02 23:37:07 +10:00
Carl Suster d8be83bc0d bpd: support ranges in playlistid 2019-06-02 23:37:07 +10:00
Carl Suster dc7e3b9b6a bpd: support nextsong in status 2019-06-02 23:37:07 +10:00
Carl Suster fdd809fd36 bpd: support more tagtypes 2019-06-02 23:37:07 +10:00
Carl Suster cc2c35221d bpd: avoid sending playlist events on navigation 2019-06-02 23:37:07 +10:00
Carl Suster 5187100294 bpd: accept all idle events 2019-06-02 23:37:07 +10:00
Carl Suster 27c462d287 bpd: make noidle a no-op outside idle mode
The real MPD ignores `noidle` when the client is not idle. It doesn't
even send a successful response, just ignores the command. Although
I don't understand why a client would fail to keep track of its own
state, it seems that this is necessary to get ncmpcpp working.
2019-06-02 23:37:07 +10:00