smartplaylist: Copy-paste-able list of playlists#6404
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tweaks the smartplaylist plugin’s CLI error output to make the “available playlists” list easier to copy/paste when a user passes an unknown playlist name.
Changes:
- Sort the available smart playlist names before printing them in the
splupdateerror. - Print the available playlist names as a space-delimited string instead of Python’s list
repr. - Add an Unreleased changelog entry describing the behavior change.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| docs/changelog.rst | Documents the updated smartplaylist error output behavior in the Unreleased changelog. |
| beetsplug/smartplaylist.py | Sorts unmatched playlist names and changes error formatting to a space-delimited list. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6404 +/- ##
=======================================
Coverage 70.05% 70.06%
=======================================
Files 147 147
Lines 18560 18563 +3
Branches 3026 3026
=======================================
+ Hits 13003 13006 +3
Misses 4924 4924
Partials 633 633
🚀 New features to boost your workflow:
|
Member
Author
|
Oh I didn't realize that playlist file names could have spaces since I don't use it like that. Hmm then this needs polishisng. Probably simply wrapping into double quotes should suffice? |
d7d1fb1 to
ed21954
Compare
JOJ0
added a commit
that referenced
this pull request
Apr 3, 2026
ed21954 to
53e9196
Compare
When supplying an invalid playlist name, the list of all playlists is shell quoted (single quotes) and becomes usable for copy/paste-ing to the user's shell.
JOJ0
added a commit
that referenced
this pull request
Apr 3, 2026
53e9196 to
d555167
Compare
JOJ0
added a commit
that referenced
this pull request
Apr 3, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2697b83 to
e87d6f4
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
e87d6f4 to
481ed7c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A simple QoL feature for
splupdate- when wanting to update multiple (not all) smartplaylists, it is not very convenient to copy-paste the name from the output the plugin uses.So for example issuing
beet splupdate non_existent_listwe get:['playlist_name_1', 'playlist name 2', ...]. This output can't easily be copy-pasted back to a shell command likeThis change handles quoting for shell using
shlex.quotewhich makes it easy to copy-paste several lists in a row (eg. with common prefixes). Also the list of playlists is now sorted alphabetically prior to printing on the shell!Addition refactorings
A tiny fix below
if not pretend:where.items()for dict-iterating should have been used in the first place.Todo
Documentation.(Not required IMO)