pull/69/head
FongMi 3 years ago
parent 5bbdb7b036
commit debb562648
  1. 2
      app/src/main/java/com/github/catvod/ali/API.java
  2. 4
      app/src/main/java/com/github/catvod/bean/ali/Item.java
  3. 4
      app/src/main/java/com/github/catvod/bean/ali/Sorter.java
  4. 2
      app/src/main/java/com/github/catvod/spider/WebDAV.java
  5. 4
      app/src/main/java/com/github/catvod/utils/Utils.java
  6. BIN
      jar/custom_spider.jar
  7. 2
      jar/custom_spider.jar.md5

@ -288,7 +288,7 @@ public class API {
} else if (file.getCategory().equals("video") || file.getCategory().equals("audio")) {
files.add(file.parent(parent.getName()));
} else if (Utils.isSub(file.getExt())) {
String key = file.removeExt();
String key = Utils.removeExt(file.getName());
if (!subMap.containsKey(key)) subMap.put(key, new ArrayList<>());
subMap.get(key).add(key + "@@@" + file.getExt() + "@@@" + file.getFileId());
}

@ -85,8 +85,4 @@ public class Item {
public String getDisplayName() {
return TextUtils.join(" ", Arrays.asList(getParent(), getName(), getSize())).trim();
}
public String removeExt() {
return getName().indexOf(".") > 0 ? getName().substring(0, getName().lastIndexOf(".")) : getName();
}
}

@ -1,5 +1,7 @@
package com.github.catvod.bean.ali;
import com.github.catvod.utils.Utils;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
@ -13,7 +15,7 @@ public class Sorter implements Comparator<Item> {
@Override
public int compare(Item o1, Item o2) {
try {
return Integer.valueOf(o1.getDisplayName()).compareTo(Integer.valueOf(o2.getDisplayName()));
return Integer.valueOf(Utils.removeExt(o1.getDisplayName())).compareTo(Integer.valueOf(Utils.removeExt(o2.getDisplayName())));
} catch (NumberFormatException e) {
return o1.getDisplayName().compareToIgnoreCase(o2.getDisplayName());
}

@ -52,7 +52,7 @@ public class WebDAV extends Spider {
}
private String removeExt(DavResource item) {
return item.getName().indexOf(".") > 0 ? item.getName().substring(0, item.getName().lastIndexOf(".")) : item.getName();
return Utils.removeExt(item.getName());
}
private static Drive getDrive(String name) {

@ -70,6 +70,10 @@ public class Utils {
return src;
}
public static String removeExt(String text) {
return text.contains(".") ? text.substring(0, text.lastIndexOf(".")) : text;
}
public static String substring(String text) {
return substring(text, 1);
}

Binary file not shown.

@ -1 +1 @@
dc64f1fe003adcd9916ee38638684376
d255d424916b37d2329cbfd8dd8b2119

Loading…
Cancel
Save