Files
beets/beetsplug
Š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
..
2025-05-04 12:23:22 +01:00
2024-09-21 11:57:48 +01:00
2025-04-21 12:41:57 +01:00
2025-02-20 03:47:04 +00:00
2024-09-21 11:57:48 +01:00
2024-09-21 11:57:48 +01:00
2024-09-21 11:57:48 +01:00
2024-09-21 11:59:18 +01:00
2024-09-21 11:57:48 +01:00
2024-09-21 11:57:48 +01:00
2024-09-21 11:57:48 +01:00
2024-09-21 11:57:48 +01:00
2024-09-21 11:57:48 +01:00
2024-09-21 11:57:48 +01:00
2023-10-22 09:53:18 +10:00
2025-05-04 12:23:22 +01:00
2024-09-21 11:59:18 +01:00
2024-09-21 11:57:48 +01:00
2024-09-21 11:57:48 +01:00
2024-09-21 11:57:48 +01:00
2024-09-21 11:57:48 +01:00
2024-09-21 11:57:48 +01:00
2024-09-21 11:57:48 +01:00
2024-09-21 11:57:48 +01:00
2025-04-14 20:50:01 +02:00
2024-09-21 11:57:48 +01:00
2023-10-22 09:53:18 +10:00
2025-04-21 12:41:57 +01:00
2023-10-22 09:53:18 +10:00
2024-09-21 11:57:48 +01:00
2024-09-21 11:57:48 +01:00
2024-09-21 11:57:48 +01:00
2025-04-21 12:41:57 +01:00
2024-09-21 11:57:48 +01:00
2023-12-20 10:28:45 -05:00
2024-06-21 15:05:29 +01:00
2024-09-21 11:57:48 +01:00
2023-12-05 13:49:03 +02:00
2025-04-14 02:58:58 +01:00
2024-03-01 15:21:25 +10:00
2024-09-21 11:57:48 +01:00
2024-12-10 06:10:04 +00:00
2024-09-21 11:57:48 +01:00
2023-10-22 09:53:18 +10:00
2024-09-21 11:57:48 +01:00
2024-05-25 12:24:53 -03:00
2025-04-21 12:41:57 +01:00
2023-10-22 09:53:18 +10:00
2024-09-21 11:57:48 +01:00