jcorporation / myMPD

myMPD is a standalone and mobile friendly web mpd client with a tiny footprint and advanced features.
https://jcorporation.github.io/myMPD/
GNU General Public License v3.0
418 stars 65 forks source link

filesystem browsing: option to sort by filename #256

Closed sebastian-de closed 3 years ago

sebastian-de commented 4 years ago

Thank you very much for your work on myMPD, I really like it so far! There is only one thing I'm missing:

Is your feature request related to a problem? Please describe. I organize my music collection in a directory structure with many sub-directories, which can contain a lot of single files that don't belong to an album. When listening to music I usually browse these directories with a file manager and pick the songs I'd like to play. When the directories aren't sorted by filename, it takes much longer for me to find the music I'd like to hear.

Describe the solution you'd like It would be nice to have an option to sort the folder contents by filename. Ideally the folders would be listed first to mimic the behavior of popular file managers.

john- commented 4 years ago

This sounds like a duplicate of this item.

sebastian-de commented 4 years ago

@john- No. When I understand the mentioned issue correctly, that was a request to generate tags from filenames.

What I like is to browse the music collection just like the actual filesystem. To be more specific: when I browse a directory, I'd like it to be sorted like the output of tree -L 1 .

Example

Output of tree -L 1 .

``` $ tree -L 1 Hip\ Hop/Roots\ Manuva Hip Hop/Roots Manuva ├── 1999 Brand New Second Hand ├── 2001 Run Come Save Me ├── 2002 Dub Come Save Me ├── 2005 Awfully Deep ├── 2005 Back to Mine ├── 2010 Roots Manuva meets Wrongtom - Duppy Writer ├── DJ Shadow - GDMFSOB (UNKLE UNCENSORED) feat. Roots Manuva.mp3 ├── Roots Manuva - Colossal Insight (Manoustic at Reading).mp3 ├── Roots Manuva - Stolen Youth.mp3 └── Roots Manuva - Stolen Youth (Segal Remix).mp3 ```

MPD lsinfo of that same directory returns:

``` [{'file': 'Hip Hop/Roots Manuva/Roots Manuva - Colossal Insight (Manoustic at Reading).mp3', 'last-modified': '2017-01-30T17:41:43Z', 'format': '44100:24:2', 'time': '240', 'duration': '239.960', 'artist': 'Roots Manuva', 'albumartist': 'Roots Manuva', 'title': 'Colossal Insight (Manoustic at Reading)', 'album': 'Awfully Deep'}, {'file': 'Hip Hop/Roots Manuva/Roots Manuva - Stolen Youth.mp3', 'last-modified': '2017-01-30T17:41:44Z', 'format': '44100:24:2', 'time': '225', 'duration': '224.679', 'artist': 'Roots Manuva', 'albumartist': 'Roots Manuva', 'title': 'Stolen Youth', 'album': 'Stolen Youth', 'track': '2', 'date': '2013', 'disc': '1'}, {'file': 'Hip Hop/Roots Manuva/Roots Manuva - Stolen Youth (Segal Remix).mp3', 'last-modified': '2017-01-30T17:41:43Z', 'format': '44100:24:2', 'time': '197', 'duration': '197.355', 'artist': 'Roots Manuva', 'albumartist': 'Roots Manuva', 'title': 'Stolen Youth (Segal Remix)', 'album': 'Stolen Youth', 'track': '3', 'date': '2013', 'disc': '1'}, {'file': 'Hip Hop/Roots Manuva/DJ Shadow - GDMFSOB (UNKLE UNCENSORED) feat. Roots Manuva.mp3', 'last-modified': '2017-01-30T17:41:43Z', 'format': '44100:24:2', 'time': '386', 'duration': '385.906', 'artist': 'DJ Shadow', 'albumartist': 'DJ Shadow', 'title': 'GDMFSOB (UNKLE UNCENSORED) feat. Roots Manuva', 'album': 'The Private Repress', 'track': '3', 'date': '2003'}, {'directory': 'Hip Hop/Roots Manuva/1999 Brand New Second Hand', 'last-modified': '2017-06-04T12:57:30Z'}, {'directory': 'Hip Hop/Roots Manuva/2001 Run Come Save Me', 'last-modified': '2017-06-04T12:53:55Z'}, {'directory': 'Hip Hop/Roots Manuva/2002 Dub Come Save Me', 'last-modified': '2017-06-04T12:48:07Z'}, {'directory': 'Hip Hop/Roots Manuva/2005 Awfully Deep', 'last-modified': '2017-06-04T12:47:06Z'}, {'directory': 'Hip Hop/Roots Manuva/2005 Back to Mine', 'last-modified': '2017-06-04T12:47:42Z'}, {'directory': 'Hip Hop/Roots Manuva/2010 Roots Manuva meets Wrongtom - Duppy Writer', 'last-modified': '2017-06-04T12:52:23Z'}] ```

This matches the sorting of the myMPD file browser, so I assume it utilizes lsinfo. I don't know if there is a reasonable way to sort this output.

jcorporation commented 4 years ago

Yes myMPD uses lsinfo. This command doesn’t support sorting (look at https://www.musicpd.org/doc/html/protocol.html). The best way would be an enhancement of MPD. Client side sorting is slow and error prone. I think you should open an issue for MPD.

sebastian-de commented 4 years ago

Thanks for your explanation. It makes sense to implement lsinfo sorting in MPD itself, then. I'll look into it there.

jcorporation commented 4 years ago

Ok, I close this issue now, feel free to reopen it if the MPD dev says that sorting should be done on client side.