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
..
bpd Fix legalize_path types 2025-05-04 12:23:22 +01:00
lastgenre lastgenre: Fix "original fallback" conditions 2025-04-09 22:52:07 +02:00
metasync
web Say bye to util._fsencoding 2025-04-21 12:41:57 +01:00
_typing.py Resurrect translation functionality 2025-02-20 03:47:04 +00:00
absubmit.py
acousticbrainz.py
advancedrewrite.py
albumtypes.py
aura.py
autobpm.py
badfiles.py
bareasc.py
beatport.py
bench.py
bpm.py
bpsync.py
bucket.py
chroma.py
convert.py Fix legalize_path types 2025-05-04 12:23:22 +01:00
deezer.py missing: support non-musicbrainz data sources 2025-04-14 02:28:42 +01:00
discogs.py missing: support non-musicbrainz data sources 2025-04-14 02:28:42 +01:00
duplicates.py
edit.py
embedart.py
embyupdate.py
export.py
fetchart.py
filefilter.py
fish.py
freedesktop.py
fromfilename.py
ftintitle.py ftintitle: flatten code 2025-04-14 20:50:01 +02:00
fuzzy.py
gmusic.py
hook.py Remove arg_encoding 2025-04-21 12:41:57 +01:00
ihate.py
importadded.py
importfeeds.py
info.py
inline.py
ipfs.py Say bye to util._fsencoding 2025-04-21 12:41:57 +01:00
keyfinder.py
kodiupdate.py
lastimport.py
limit.py
listenbrainz.py fix: plugins/listenbrainz: Fix UnboundLocalError in cases where 'mbid' is not defined (#5651) 2025-03-12 07:08:53 +00:00
loadext.py
lyrics.py translations: use a more distinctive separator 2025-02-20 03:47:04 +00:00
mbcollection.py
mbsubmit.py
mbsync.py Tidy up mbsync logs 2025-04-14 02:58:58 +01:00
missing.py missing: clarify that only musicbrainz backend supports missing albums for artist 2025-04-14 02:28:43 +01:00
mpdstats.py
mpdupdate.py
parentwork.py Only output verbose details for parentwork plugin when running explicitly (#5135) 2025-05-04 09:34:37 +02:00
permissions.py
play.py
playlist.py
plexupdate.py
random.py
replaygain.py
rewrite.py
scrub.py
smartplaylist.py smartplaylist: change encoding of additional field 2025-02-01 01:14:27 +01:00
sonosupdate.py
spotify.py
subsonicplaylist.py
subsonicupdate.py
substitute.py
the.py
thumbnails.py Say bye to util._fsencoding 2025-04-21 12:41:57 +01:00
types.py Apply formatting tools to all files 2023-10-22 09:53:18 +10:00
unimported.py
zero.py