This commit is contained in:
GH Action - Upstream Sync 2023-04-23 12:30:13 +00:00
commit 818baca2a0
9 changed files with 12 additions and 10 deletions

View File

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

View File

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

View File

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

View File

@ -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) {

View File

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

View File

@ -1 +1 @@
dc64f1fe003adcd9916ee38638684376
d255d424916b37d2329cbfd8dd8b2119

View File

@ -1,5 +1,5 @@
{
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;dc64f1fe003adcd9916ee38638684376",
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;d255d424916b37d2329cbfd8dd8b2119",
"wallpaper": "https://gao.chuqiuyu.tk",
"sites": [
{

View File

@ -1,5 +1,5 @@
{
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;dc64f1fe003adcd9916ee38638684376",
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;d255d424916b37d2329cbfd8dd8b2119",
"wallpaper": "http://饭太硬.ga/深色壁纸/api.php",
"sites": [
{