-
Couldn't load subscription status.
- Fork 1.9k
fix convert func #6134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix convert func #6134
Conversation
|
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes - here's some feedback:
- Add a fallback to item.destination(...) when building playlist entries in case item.path isn’t populated yet to avoid missing‐path errors.
- Ensure you’re still handling encoding (bytes vs unicode) for playlist lines to prevent regressions with non-ASCII filenames.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Add a fallback to item.destination(...) when building playlist entries in case item.path isn’t populated yet to avoid missing‐path errors.
- Ensure you’re still handling encoding (bytes vs unicode) for playlist lines to prevent regressions with non-ASCII filenames.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
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 Also, looks like commit 933132f 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! |
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
docs/to describe it.)docs/changelog.rstto the bottom of one of the lists near the top of the document.)