This commit is contained in:
FongMi 2023-08-30 13:40:32 +08:00
parent 6c67555168
commit def578029a
4 changed files with 7 additions and 7 deletions

View File

@ -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());
}
}

View File

@ -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.

View File

@ -1 +1 @@
e202ef069c4742cadfd707f4b144ed2a
50095fdf21e5b6f4c21d64bd8e163063