Jump to content

Sort by name ignoring hyphens?


Go to solution Solved by Luke,

Recommended Posts

Trizzone52
Posted

I'm not sure if the sort-by-name state is taking into account hyphens (-) in the name when sorting.  

 

This is an issue for me, as I use folder names to sort by dates.  In folder and name sorting, it sorts in the following order:

2016; 2017; 2017_1FolderDesc; 2018; 2012-08; 2015-01; 2011-01-04; 2011-01-05; 2016-10-06.

 

My current guess for why the current sorting order occurs is that the sort algorithm is ignoring hyphens in numbers or something similar. Causing the above to be sorted as:

2016; 2017; 2017_1FolderDesc; 2018; 201208; 201501; 20110104; 20110105; 20161006.

 

As the above refers to dates, I would rather them sort in ascending order. Similar to how Windows or Linux explorers display when sorted  by name:

2011-01-04; 2011-01-05; 2012-08; 2015-01; 2016; 2016-10-06; 2017; 2017_1FolderDesc; 2018.

 

Questions:

Do you know if this is intentional?

Could someone check the code where it describes this behavior, or point me in the right direction or to the right file in the source code? 

 

 

 

PS: Not sure if this should be a feature request or a bug report.

Posted

It's not ignoring, it's just how sqlite is sorting them. It is on our internal tracker to review. Thanks.

  • Like 1
Trizzone52
Posted

Thank you much for giving it a look!

  • 10 months later...
Posted

I see this line in the 4.4.0.7-beta branch:

*Various sorting fixes (most apply to new server installations only)

Does anyone know if this topic's feature was included as part of those changes?  (I wanted to ask before the hassle of uninstalling-reinstalling the server to test.)

Posted

I didn't specifically test your given examples, but yes i have a feeling the changes will help with them.

  • Solution
Posted

 

@@Happy2Play just fyi, with the new sorting on brand new installations, there are no more remove characters. The sorting can handle the presence of the characters without having to remove them. There is only the remove words so that you can strip out the, a, etc.

  • Like 1
Happy2Play
Posted

Theoretically all you have to do is remove the media, scan, then re-add the media.  A uninstall/reinstall shouldn't be needed.  But clean installs can work out any other old issues that may have happened in previous updates.

 

Haven't personally done any testing on this yet.

Posted

For these sorting improvements yes it actually only applies to brand new installations as there's no easy way to upgrade existing servers into the new behavior. Existing servers will just continue on the way they are.

  • Like 1
pwhodges
Posted

Presumably this is because the sort parameters for the database table concerned are baked in to the DB at the time of creation of the table.

 

Paul

  • Like 1
Posted

Finally got around to doing a fresh install of Emby, and can confirm that 4.4.0.8-beta has the sorting redone and that it behaves as I originally asked for.  Thanks for making this update.

 

(Can also confirm just re-adding the library doesn't currently update the sorting. A fresh database from a re-install is needed. I just finished testing both on my server.)

Posted

Thanks for the feedback.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...