nvllsvm / Audinaut

A Subsonic client for Android
GNU General Public License v3.0
134 stars 18 forks source link

Sort artists using case insensitive comparison when offline #73

Closed simao closed 4 years ago

simao commented 4 years ago

When online, Audinaut uses the artists in the order the server returns them. When offline, this order depends on the order in which FileUtils returns the files and directories.

This means that currently Audinaut shows artists in the following order when online (uses the sorting from the server):

Air
algodao
Black Keys

But like this when offline:

Air
Black Keys
algodao

Which I think is confusing to the user.

This PR changes Audinat to sort artists with case insensitive comparison, the same way the server returns them.

I am not sure this is the best way to implement this. Initially I just implemented Indexes.sortChildren which was implemented as a NOOP. This would trigger the sorting for both offline and online. This seemed like a better solution, but I was worried this would have an impact for users with very big libraries, since they the library would be sorted from the server and then Audinaut would sort it again. Maybe this was why the method was left implemented?

Please let me know if that solution would be better and I can implement it back.

Thanks

nvllsvm commented 4 years ago

Implement the same sorting for online as well. Consistency is a better user experience.

simao commented 4 years ago

Hi. I updated the PR to do the same for offline and online