Skip to content

nightly-1943b145-ls250

Pre-release
Pre-release

Choose a tag to compare

@LinuxServer-CI LinuxServer-CI released this 17 Mar 18:49
· 23 commits to nightly since this release
ea0586f

CI Report:

https://ci-tests.linuxserver.io/linuxserver/beets/nightly-1943b145-ls250/index.html

LinuxServer Changes:

No changes

Remote Changes:

Refactor of layout utils (#6442)

This PR refactors import-match layout rendering by centralizing layout
selection and line generation in beets.util.layout, simplifying the
ShowChange display path, and tightening the layout
data model.

What Changed

  • Added get_layout_lines() and get_layout_method() in
    beets.util.layout so layout selection (column vs newline) is
    handled in one place.
  • Replaced Side from a mutable TypedDict with an immutable
    NamedTuple that exposes derived helpers (rendered, prefix/suffix
    widths, and rendered width).
  • Simplified split_into_lines() from a 3-width tuple API to
    (first_width, width) and removed legacy last-line empty-string
    handling.
  • Refactored beets.ui.commands.import_/display.py ShowChange to call
    get_layout_lines() directly and removed duplicate per-class
    layout-selection logic.
  • Updated tracklist width calculation to use Side helpers and explicit
    width assignment via _replace(width=...).
  • Reworked ShowChange tests into snapshot-style assertions for both
    newline and column layouts, and updated util layout tests to the new
    split_into_lines() signature.

Why

  • Reduces duplicated wrapping/layout logic across UI code paths.
  • Makes layout behavior easier to reason about and test at the utility
    boundary.
  • Narrows the display layer to orchestration while keeping
    transformation/rendering logic in reusable utilities.
  • Improves maintainability by moving from loosely typed dict mutation to
    a typed, self-describing data structure.