MPD
MPD copied to clipboard
Add sort paramter to `list`
Feature request
#2255 implements the window parameter for list. To complete the implementation a sort parameter would be very useful.
I don't think it makes sense at all. Maybe you could name an example that demonstrates the usefulness?
An example could be: List 100 Artists in descending order.
Without a sort parameter a client must fetch all the artists and must implement the sorting and the new window parameter in MPD is useless in this scenario.
How exactly would this command line look like? What other sort options would there be?
Sorting by the tag we list should be suffice:
list {TYPE} {FILTER} [group {GROUPTYPE}] [window {START:END}] [sort {SORTDIRECTION}]
SORTDIRECTION is asc or desc
Edit: Eventually it is better to not use the sort keyword as it is used differently in other commans. order could be better:
list {TYPE} {FILTER} [group {GROUPTYPE}] [window {START:END}] [order {SORTDIRECTION}]
Sorting by the tag we list should be suffice:
Not quite
- any other tag is impossible to sort by
- you're slightly wrong - you can only sort the top-most tag, which is not the listed-by tag if there is a
group(thelistcommand is more complicated that it seems, but people wanted it that way)
Anyway we agree that only one tag is ever possible, therefore only the direction can possibly be chosen.
But is it really necessary to have descending order? The client can choose a window that's at the bottom, can't it?
Edit: Eventually it is better to not use the
sortkeyword as it is used differently in other commans.ordercould be better:
Hm, order seems somewhat ambiguous. Maybe direction?
But is it really necessary to have descending order? The client can choose a window that's at the bottom, can't it?
The client does not know the bottom index or do I miss anything?
direction is good for me.
I don't think direction is enough as a sort option.
I think users expect sorting to be in linguistic order according to language. See: ICU collation
At the very least case-sensitivity, but also accents and umlauts, language articles and more.
Without a proper sort options, the window is not so useful. Clients have to take the whole list and sort locally according to user preferences. Not only in list command but the others as well.
@geneticdrift, you are talking about a very different aspect that is orthogonal to the concept discussed here. It would be possible add a command, say locale that lets the client declare the preferred locale to the server, so MPD can use ICU's locale features to make sorting/comparisons language-specific.
@geneticdrift : I think your proposal is worth a new feature request.