Skip to content

smartplaylist plugin does not retain order of queries #6183

@TacticalLaptopBag

Description

@TacticalLaptopBag

Problem

Running this command in verbose (-vv) mode:

$ beet -vv splupdate

Led to this problem:

user configuration: /home/user/.config/beets/config.yaml
data directory: /home/user/.config/beets
plugin paths: []
Loading plugins: smartplaylist
Sending event: pluginload
library database: /music/beets/musiclibrary.db
library directory: /music/Library
Sending event: library_opened
Parsed query: AndQuery([SubstringQuery('artist', 'Lost Years', fast=True), SubstringQuery('album', 'Pressure', fast=True)])
Parsed sort: NullSort()
Parsed query: AndQuery([SubstringQuery('artist', 'Turbo', fast=True), OrQuery([SubstringQuery('artist', 'Knight', fast=True), SubstringQuery('title', 'Knight', fast=True), SubstringQuery('comments', 'Knight', fast=True), SubstringQuery('album', 'Knight', fast=True), SubstringQuery('albumartist', 'Knight', fast=True), SubstringQuery('genre', 'Knight', fast=True)])])
Parsed sort: NullSort()
Parsed query: AndQuery([SubstringQuery('artist', 'Deorro', fast=True), OrQuery([SubstringQuery('artist', 'Five Hours', fast=True), SubstringQuery('title', 'Five Hours', fast=True), SubstringQuery('comments', 'Five Hours', fast=True), SubstringQuery('album', 'Five Hours', fast=True), SubstringQuery('albumartist', 'Five Hours', fast=True), SubstringQuery('genre', 'Five Hours', fast=True)])])
Parsed sort: NullSort()
smartplaylist: Updating 1 smart playlists...
smartplaylist: Creating playlist neRd-test.m3u
Sending event: smartplaylist_update
smartplaylist: 1 playlists updated
Sending event: cli_exit

Here's a link to the music files that trigger the bug (if relevant): Happens with any music file

Setup

  • OS: Kubuntu 25.04
  • Python version: 3.13.3
  • beets version: 2.5.1
  • Turning off plugins made problem go away (yes/no): no - I disabled everything but smartplaylist and still have this issue

My configuration (output of beet config) is:

directory: /music/Library
library: /music/beets/musiclibrary.db
# library: ~/.config/beets/musiclibrary.db
artist_credit: no

replace: {
    "": '',
    "": '',
    '"': "",
    "": "'",
    # remove ascii control characters
    '[\x00-\x1f]': "_",
    # spaces at the beginning and and
    '\s+$': "",
    '^\s+': "",
    ":": "",
    "\\?": "",
}

plugins:
  - smartplaylist

smartplaylist:
  auto: yes
  relative_to: /music/Playlists
  playlist_dir: /music/Playlists
  forward_slash: yes
  playlists:
    - name: "neRd-test.m3u"
      query:
        - "'artist:Lost Years' album:Pressure"
        - "artist:Turbo Knight"
        - "artist:Deorro 'Five Hours'"

I expected the order of the playlist to be the following:

  1. Lost Years' Pressure
  2. All tracks by Turbo Knight
  3. Deorro's Five Hours

Instead, the playlist was populated like so:

  1. Deorro's Five Hours
  2. Lost Years' Pressure
  3. All tracks by Turbo Knight

Metadata

Metadata

Assignees

No one assigned

    Labels

    pluginPull requests that are plugins related

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions