fix convert func
Description
Fixes #5786. convert's playlist option uses original extensions
Added a Fallback for Missing Paths: Instead of directly calling item.path which may sometimes be empty or uninitialized, the code now uses item.path if populated; otherwise, it falls back to item.destination(...). This prevents potential missing-path errors during playlist entry creation by ensuring every item has a valid file path.
Improved Readability and Style Compliance: The complex ternary expression was reformatted using implicit line continuation inside parentheses, breaking the line across multiple lines. This improves readability and addresses style/linting issues related to line length limits.
Handled Unicode and Encoding: Playlist entries are checked to ensure proper encoding by decoding bytes to UTF-8 strings as needed. This avoids regressions with non-ASCII filenames ensuring better compatibility.
To Do
- [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.rstto the bottom of one of the lists near the top of the document.) - [x] Tests. (Very much encouraged but not strictly required.)
Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.
Hi! Thanks for the PR, can you link the issue this addresses or provide more context to the fix?
@henry-oberholtzer I have edited the description comment at the top. Check it out! and let me know if you need any more detail or changes.
Lint check is not getting successful for no reason? Can you please go through it once please.
You'll need to run poe format and it should fix the issue - the failure is a little obtuse to read but it will let you know what it fails on.
Also, looks like commit https://github.com/beetbox/beets/pull/6134/commits/933132f71ec1a899cf60de7203a14d4fe0d01951 removed the test you wrote!
Thank you for the PR!
Since this seems to be your first contribution to beets, you might want to have a quick look at our contribution guide and the developer documentation to get familiar with our workflow and coding conventions.
We're thrilled to have you contributing, welcome to the community!