Fix old Fav sorting issue

This commit is contained in:
sonora 2016-02-27 19:43:39 +01:00
parent e6a336368f
commit fd9ad702f3

View file

@ -515,6 +515,13 @@ public class FavouritesDbHelper {
int i2 = Algorithms.extractIntegerNumber(s2); int i2 = Algorithms.extractIntegerNumber(s2);
String ot1 = Algorithms.extractIntegerPrefix(s1); String ot1 = Algorithms.extractIntegerPrefix(s1);
String ot2 = Algorithms.extractIntegerPrefix(s2); String ot2 = Algorithms.extractIntegerPrefix(s2);
// Next 6 lines needed for correct comparison of names with and without digits
if (ot1.length() == 0) {
ot1 = s1;
}
if (ot2.length() == 0) {
ot2 = s2;
}
int res = collator.compare(ot1, ot2); int res = collator.compare(ot1, ot2);
if (res == 0) { if (res == 0) {
res = i1 - i2; res = i1 - i2;