beetbox / beetbox/beets

playlist: sorting of an on-disk playlist is ignored

Open
#4,553 7 comments 0 reactions 0 assignees View on GitHub
feature playlist
Dominant language
Python
Stars
15.7k
Forks
2.1k
Avg merge
4d 21h
Merged PRs (30d)
31

Description

When using the playlist plugin for querying (syntax `playlist:/path/to/list.m3u`) it seems like the sorting of the list is lost.

### Problem

We see that even though the query sorts by bpm and the playlist file (saved by smartplaylist plugin earlier) is sorted by bpm ascending, it gets lost when the `playlist:....` syntax is used:

```

prod  (beets)    ~/git/beets   all_in ●  beet config | grep include:
include: [smart_playlists.yaml]
prod  (beets)    ~/git/beets   all_in ●  cat $BEETSDIR/smart_playlists.yaml
smartplaylist:
auto: yes
playlists:
- name: 110..130_TechnoJungleDub_Hi.m3u
query: >
year:1993.. bpm:110..130 "genre::(?i)Jungle|Footwork|Drum & Bass|Drum and Bass|Dubstep|Bass" initial_key+ bpm+ bitrate:200000..

- name: mood_happy_relaxed.m3u
query: >
mood_happy:0.8.. mood_relaxed:0.8.. bpm+ initial_key+

- name: mood_sad_relaxed.m3u
query: >
mood_sad:0.9.. mood_relaxed:0.9.. bpm+ initial_key+

- name: mood_acoustic_relaxed.m3u
query: >
mood_acoustic:0.9.. mood_relaxed:0.9.. bpm+ initial_key+




  prod  (beets)    ~/git/beets   all_in ●  beet ls mood_acoustic:0.9.. mood_relaxed:0.9.. bpm+ initial_key+ -f '$bpm, $initial_key, $artist, $title' | head -5
70, Dm, Aphex Twin, Nanou 2
83, , µ-Ziq, Fall Of Antioch
90, F, Wisp, Around Corners
91, A, Portishead, Deep Water
92, G, Clueso, Barfuß

prod  (beets)    ~/git/beets   all_in ●  beet ls playlist:/remote/data/music-library/0-playlists/mood_acoustic_relaxed.m3u -f '$bpm, $initial_key, $artist, $title' | head -5
148, , Long Beach Dub Allstars, Love Her Madly
166, D, Deep & Wide, Seven Seas
161, Fm, Squarepusher, 213 (Maritime Eposis)
105, Em, Squarepusher, Spymania Theme
108, C, Harold Budd, Balthus Bemused by Colour

  prod  (beets)    ~/git/beets   all_in ●  head -5 /remote/data/music-library/0-playlists/mood_acoustic_relaxed.m3u
/remote/data/music-library/IDM,Electronica/Aphex Twin/2001 - Aphex Twin - Drukqs/30 - Aphex Twin - Drukqs - Nanou 2 (2001).mp3
/remote/data/music-library/IDM,Electronica/u-Ziq/2003 - u-Ziq - Bilious Paths/11 - u-Ziq - Bilious Paths - Fall Of Antioch (2003).mp3
/remote/data/music-library/IDM,Electronica/Wisp/2004 - Wisp - About Things That Never Were/09 - Wisp - About Things That Never Were - Around Corners (2004).mp3
/remote/data/music-library/DowntempoTriphopDubAcidjazz/Portishead/2008 - Portishead - Third/07 - Portishead - Third - Deep Water (2008).m4a
/remote/data/music-library/AlternativeRockPop/Clueso/2008 - Clueso - So sehr dabei/01 - Clueso - So sehr dabei - Barfuss (2008).mp3
```

### Setup

* OS: Manjaro
* Python version: 3.9
* beets version: git latest
* Turning off plugins made problem go away (yes/no): FIXME

My configuration (output of `beet config`) is:

See above for the IMHO relevant parts. Can certainly provide more on demand.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.