Skip to content

smartplaylist: Enrich original "Creating output" with track counts; CLI output overhaul#6493

Merged
JOJ0 merged 8 commits intomasterfrom
spl_quiet
Apr 19, 2026
Merged

smartplaylist: Enrich original "Creating output" with track counts; CLI output overhaul#6493
JOJ0 merged 8 commits intomasterfrom
spl_quiet

Conversation

@JOJ0
Copy link
Copy Markdown
Member

@JOJ0 JOJ0 commented Apr 3, 2026

Description

  • The per-playlist summary now includes a track count (Creating playlist X: N tracks.) at INFO level.
  • The --pretend flag produces the same output but reports "N playlists would be updated" instead of "N playlists updated".
  • Per-track details are shown only in DEBUG log level.
  • The --format option allows customizing the track line format.
  • The __apply_opts_to_config helper was removed and instead defaults provided when defining CLI options
  • Fix a tiny bug: Deduplicate playlist entries by URI and only increment matched counts when a new entry is added.
  • The --pretend-paths option was removed since now the per-track log format is configurable anyway.

To Do

  • Documentation.
  • Changelog.
  • Tests.

@JOJ0 JOJ0 changed the base branch from master to spl_copy_paste_able April 3, 2026 17:44
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 3, 2026

Codecov Report

❌ Patch coverage is 81.25000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.84%. Comparing base (29afc36) to head (e801e90).
⚠️ Report is 10 commits behind head on master.

Files with missing lines Patch % Lines
beetsplug/smartplaylist.py 81.25% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6493      +/-   ##
==========================================
+ Coverage   71.78%   71.84%   +0.06%     
==========================================
  Files         156      156              
  Lines       20176    20173       -3     
  Branches     3214     3209       -5     
==========================================
+ Hits        14484    14494      +10     
+ Misses       5006     5000       -6     
+ Partials      686      679       -7     
Files with missing lines Coverage Δ
beetsplug/smartplaylist.py 82.56% <81.25%> (+6.30%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JOJ0 JOJ0 force-pushed the spl_copy_paste_able branch from e87d6f4 to 481ed7c Compare April 3, 2026 17:50
JOJ0 added a commit that referenced this pull request Apr 3, 2026
@JOJ0 JOJ0 added the plugin Pull requests that are plugins related label Apr 4, 2026
@snejus snejus force-pushed the spl_copy_paste_able branch from 481ed7c to b32f220 Compare April 4, 2026 12:35
@snejus snejus added smartplaylist smartplaylist plugin and removed plugin Pull requests that are plugins related labels Apr 4, 2026
Base automatically changed from spl_copy_paste_able to master April 4, 2026 12:41
@JOJ0 JOJ0 marked this pull request as ready for review April 5, 2026 06:31
@JOJ0 JOJ0 requested a review from a team as a code owner April 5, 2026 06:31
Copilot AI review requested due to automatic review settings April 5, 2026 06:31

This comment was marked as outdated.

Comment thread beetsplug/smartplaylist.py Outdated
JOJ0 added a commit that referenced this pull request Apr 14, 2026
@JOJ0 JOJ0 force-pushed the spl_quiet branch 2 times, most recently from 43585cf to a6925de Compare April 14, 2026 21:42
JOJ0 added a commit that referenced this pull request Apr 14, 2026
JOJ0 added a commit that referenced this pull request Apr 14, 2026
@JOJ0 JOJ0 requested a review from Copilot April 14, 2026 23:00
@JOJ0 JOJ0 force-pushed the spl_quiet branch 2 times, most recently from ba4dadc to 3cfcf98 Compare April 19, 2026 15:32
@JOJ0 JOJ0 mentioned this pull request Apr 19, 2026
@JOJ0 JOJ0 requested a review from snejus April 19, 2026 15:43
@JOJ0
Copy link
Copy Markdown
Member Author

JOJ0 commented Apr 19, 2026

This is ready for an (hopefully) final review @snejus :-)

Comment thread beetsplug/smartplaylist.py
Comment thread docs/changelog.rst Outdated
Comment thread test/plugins/test_smartplaylist.py Outdated
Comment thread docs/plugins/smartplaylist.rst
Comment thread docs/changelog.rst Outdated
Comment thread docs/changelog.rst Outdated
@JOJ0 JOJ0 force-pushed the spl_quiet branch 2 times, most recently from 336dac6 to e55cf66 Compare April 19, 2026 20:33
Comment thread test/plugins/test_smartplaylist.py Outdated
@JOJ0 JOJ0 force-pushed the spl_quiet branch 2 times, most recently from 05ea82e to f288f07 Compare April 19, 2026 20:47
Comment thread test/plugins/test_smartplaylist.py
JOJ0 added 8 commits April 19, 2026 22:55
which enhances code readability for future readers.
Deduplicate playlist output by URI instead of comparing bytes to
PlaylistItem objects. Increment matched/pretend counts only when a new
entry is actually added. This prevents duplicate lines when the same
track is reached via multiple query paths.
- Enrich CLI per playlist summaries with matched track counts
- Move per-track log lines to DEBUG log level (beet -vv)
- Make per-track log lines configurable (format)
- Remove the pretend_paths config/flag (now configurable anyway)
- Improve existing help texts
- Provide defaults when adding CLI options already
- Use a single config.set() call instead of using a helper method
- Since we cant control much of the add_format_option helper, let's
  define that option here manually instead (otherwise we would have to
  handle a default of None)
@JOJ0
Copy link
Copy Markdown
Member Author

JOJ0 commented Apr 19, 2026

I think now all remaining issues are addressed and we might be good to go :-) It turned out to be somewhat different than planned but in a good way. Happy with the result. Many thanks again for reviewing!

@JOJ0 JOJ0 enabled auto-merge April 19, 2026 21:00
Copy link
Copy Markdown
Member

@snejus snejus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@JOJ0 JOJ0 merged commit 61a4ba9 into master Apr 19, 2026
22 checks passed
@JOJ0 JOJ0 deleted the spl_quiet branch April 19, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

smartplaylist smartplaylist plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants