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 Reformat the codebase 2024-09-21 11:57:48 +01:00
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 Reformat the codebase 2024-09-21 11:57:48 +01:00
acousticbrainz.py Reformat the codebase 2024-09-21 11:57:48 +01:00
advancedrewrite.py Merge pull request #5063 from Maxr1998/fix-advancedrewrite-simple-rules 2024-03-01 16:08:37 +10:00
albumtypes.py Reformat the codebase 2024-09-21 11:57:48 +01:00
aura.py Use Item.field_query for queries that receive user input 2025-01-19 01:09:11 +00:00
autobpm.py Move imports required for typing under the TYPE_CHECKING block 2024-12-10 06:10:04 +00:00
badfiles.py Fix lint issues 2024-09-21 11:59:18 +01:00
bareasc.py Reformat the codebase 2024-09-21 11:57:48 +01:00
beatport.py Reformat the codebase 2024-09-21 11:57:48 +01:00
bench.py Reformat the codebase 2024-09-21 11:57:48 +01:00
bpm.py Reformat the codebase 2024-09-21 11:57:48 +01:00
bpsync.py Reformat the codebase 2024-09-21 11:57:48 +01:00
bucket.py Reformat the codebase 2024-09-21 11:57:48 +01:00
chroma.py Apply formatting tools to all files 2023-10-22 09:53:18 +10:00
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 Fix lint issues 2024-09-21 11:59:18 +01:00
edit.py Reformat the codebase 2024-09-21 11:57:48 +01:00
embedart.py Apply formatting tools to all files 2023-10-22 09:53:18 +10:00
embyupdate.py Reformat the codebase 2024-09-21 11:57:48 +01:00
export.py Reformat the codebase 2024-09-21 11:57:48 +01:00
fetchart.py Reformat the codebase 2024-09-21 11:57:48 +01:00
filefilter.py Reformat the codebase 2024-09-21 11:57:48 +01:00
fish.py Reformat the codebase 2024-09-21 11:57:48 +01:00
freedesktop.py Reformat the codebase 2024-09-21 11:57:48 +01:00
fromfilename.py Apply formatting tools to all files 2023-10-22 09:53:18 +10:00
ftintitle.py ftintitle: flatten code 2025-04-14 20:50:01 +02:00
fuzzy.py Reformat the codebase 2024-09-21 11:57:48 +01:00
gmusic.py Apply formatting tools to all files 2023-10-22 09:53:18 +10:00
hook.py Remove arg_encoding 2025-04-21 12:41:57 +01:00
ihate.py Apply formatting tools to all files 2023-10-22 09:53:18 +10:00
importadded.py Apply formatting tools to all files 2023-10-22 09:53:18 +10:00
importfeeds.py Reformat the codebase 2024-09-21 11:57:48 +01:00
info.py Reformat the codebase 2024-09-21 11:57:48 +01:00
inline.py Reformat the codebase 2024-09-21 11:57:48 +01:00
ipfs.py Say bye to util._fsencoding 2025-04-21 12:41:57 +01:00
keyfinder.py Reformat the codebase 2024-09-21 11:57:48 +01:00
kodiupdate.py Add timeout to all requests calls 2024-05-25 12:24:53 -03:00
lastimport.py Update lastimport.py 2023-12-20 10:28:45 -05:00
limit.py Add support for filtering relations 2024-06-21 15:05:29 +01:00
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 Reformat the codebase 2024-09-21 11:57:48 +01:00
lyrics.py translations: use a more distinctive separator 2025-02-20 03:47:04 +00:00
mbcollection.py Apply formatting tools to all files 2023-10-22 09:53:18 +10:00
mbsubmit.py mbsubmit: Add picard PromptChoice 2023-12-05 13:49:03 +02:00
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 Apply formatting tools to all files 2023-10-22 09:53:18 +10:00
mpdupdate.py Apply formatting tools to all files 2023-10-22 09:53:18 +10:00
parentwork.py Only output verbose details for parentwork plugin when running explicitly (#5135) 2025-05-04 09:34:37 +02:00
permissions.py Apply formatting 2024-03-01 15:21:25 +10:00
play.py Reformat the codebase 2024-09-21 11:57:48 +01:00
playlist.py Update deprecated imports 2024-12-10 06:10:04 +00:00
plexupdate.py Add timeout to all requests calls 2024-05-25 12:24:53 -03:00
random.py Reformat the codebase 2024-09-21 11:57:48 +01:00
replaygain.py Move imports required for typing under the TYPE_CHECKING block 2024-12-10 06:10:04 +00:00
rewrite.py Apply formatting tools to all files 2023-10-22 09:53:18 +10:00
scrub.py Reformat the codebase 2024-09-21 11:57:48 +01:00
smartplaylist.py smartplaylist: change encoding of additional field 2025-02-01 01:14:27 +01:00
sonosupdate.py Apply formatting tools to all files 2023-10-22 09:53:18 +10:00
spotify.py Add timeout to all requests calls 2024-05-25 12:24:53 -03:00
subsonicplaylist.py Add timeout to all requests calls 2024-05-25 12:24:53 -03:00
subsonicupdate.py Add timeout to all requests calls 2024-05-25 12:24:53 -03:00
substitute.py Apply substitute rules in sequence 2024-10-16 16:36:36 +02:00
the.py Use PEP585 lowercase collections typing annotations 2024-12-10 06:10:03 +00:00
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 bugfix: ignore subdirectories of ignored 2024-03-22 18:20:47 -04:00
zero.py Reformat the codebase 2024-09-21 11:57:48 +01:00