MatteoGuadrini / mkpl

Make M3U format playlist from command line
https://matteoguadrini.github.io/mkpl
GNU General Public License v3.0
27 stars 2 forks source link

Shuffles order every time #4

Closed aburchio closed 1 year ago

aburchio commented 1 year ago

I can't find a way to instruct mkpl to create playlist "in album order". it's like the "shuffle" option is always set. basically this is what happens:

$ cd Electric\ Light\ Orchestra\ (1975)\ Face\ The\ Music/

$ mkpl test.m3u

$ cat test.m3u 11 - Strange Magic [Single Edit].m4a 01 - Fire On High.m4a 03 - Evil Woman.m4a 06 - Strange Magic.m4a 04 - Nightrider.m4a 07 - Down Home Town.m4a 05 - Poker.m4a 10 - Evil Woman [Stripped Down Mix].m4a 09 - Fire On High [Early Alternate Mix].m4a 12 - Waterfall [Instrumental Mix].m4a 08 - One Summer Dream.m4a 02 - Waterfall.m4a

MatteoGuadrini commented 1 year ago

Hi @aburchio, actually the order is not random, but it is returned from the file system directly. So if you make a list (ls) of the same directory, the order will be the same as the playlist.

I could implement two new flags:

It might solve the problem you discovered...

life5ign commented 1 year ago

Any chance of using a Python IDE/MP3 tag library to look at the track field, and order by that? I love this project, but I'm finding it unusable because most of my music files don't have the track at the beginning of the file's basename, so they don't sort by track, and thus appear in a non desirable, although lexical by filename, order in the playlist, which makes it unusable.

MatteoGuadrini commented 1 year ago

Hi @life5ign, actually, mkpl grew out of an evolution of my bash script for dynamic playlist creation and as such, evolved into the logical sphere of the file system. Getting into the logic of file metadata would be very useful, because you can filter them not only by file name, but by their tags.

I might consider integrating with the Mutagen library, which allows you to access tags of various formats. By doing so, I could then create various arguments that allow filters for tracks, titles, albums, etc...

I would ask you to open a separate issue for me, in order to manage the workflow in a coherent way. A thousand thanks

aburchio commented 1 year ago

I could implement two new flags:

* `-o`, `--orderby-name`: order list of multimedia files by name

* `-O`, `--orderby-date`: order list of multimedia files by creation date

I have tried some commands after your reply and yes, some commands like 'find' will return the list in an unsorted order, while 'ls' seems to work fine on my system. If you could implement some type of sorting it would be very useful, because mkpl would not rely on commands generated order, that could be wrong or confusing.