Update
This commit is contained in:
parent
6c67555168
commit
def578029a
|
|
@ -87,11 +87,11 @@ public class Item implements Comparable<Item> {
|
|||
}
|
||||
|
||||
public String getSortName() {
|
||||
return TextUtils.join(" ", Arrays.asList(getParent(), getName())).trim();
|
||||
return TextUtils.join(" ", Arrays.asList(getParent(), Utils.getDigit(getName()))).trim();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Item item) {
|
||||
return Integer.compare(Utils.getDigit(getSortName()), Utils.getDigit(item.getSortName()));
|
||||
return getSortName().compareTo(item.getSortName());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -192,13 +192,13 @@ public class Utils {
|
|||
});
|
||||
}
|
||||
|
||||
public static int getDigit(String text) {
|
||||
public static String getDigit(String text) {
|
||||
try {
|
||||
Matcher matcher = Pattern.compile(".*(1080|720|2160|4k|4K).*").matcher(text);
|
||||
if (matcher.find()) text = matcher.group(1) + text;
|
||||
return Integer.parseInt(text.replaceAll("\\D+", ""));
|
||||
if (matcher.find()) text = matcher.group(1) + " " + text;
|
||||
return text.replaceAll("\\D+", "");
|
||||
} catch (Exception e) {
|
||||
return -1;
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
e202ef069c4742cadfd707f4b144ed2a
|
||||
50095fdf21e5b6f4c21d64bd8e163063
|
||||
|
|
|
|||
Loading…
Reference in New Issue