Fix local sort
This commit is contained in:
parent
e2584d6283
commit
1c4ebf9aeb
|
|
@ -54,18 +54,17 @@ public class Local extends Spider {
|
|||
@Override
|
||||
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) throws Exception {
|
||||
List<Vod> items = new ArrayList<>();
|
||||
List<Vod> media = new ArrayList<>();
|
||||
List<Vod> folders = new ArrayList<>();
|
||||
File[] files = new File(tid).listFiles();
|
||||
if (files == null) return Result.string(items);
|
||||
Arrays.sort(files, (a, b) -> a.getName().compareTo(b.getName()));
|
||||
Arrays.sort(files, (o1, o2) -> {
|
||||
if (o1.isDirectory() && o2.isFile()) return -1;
|
||||
if (o1.isFile() && o2.isDirectory()) return 1;
|
||||
return o1.getName().toLowerCase().compareTo(o2.getName().toLowerCase());
|
||||
});
|
||||
for (File file : files) {
|
||||
if (file.getName().startsWith(".")) continue;
|
||||
if (file.isDirectory()) folders.add(create(file));
|
||||
else if (Util.isMedia(file.getName())) media.add(create(file));
|
||||
if (file.isDirectory() || Util.isMedia(file.getName())) items.add(create(file));
|
||||
}
|
||||
items.addAll(folders);
|
||||
items.addAll(media);
|
||||
return Result.get().vod(items).page().string();
|
||||
}
|
||||
|
||||
|
|
@ -97,7 +96,7 @@ public class Local extends Spider {
|
|||
vod.setVodName(name);
|
||||
vod.setVodPic(Image.VIDEO);
|
||||
vod.setVodPlayFrom("播放");
|
||||
vod.setVodPlayUrl(name + "$" + url);
|
||||
vod.setVodPlayUrl(1 + "$" + url);
|
||||
return vod;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public class Push extends Spider {
|
|||
|
||||
@Override
|
||||
public String playerContent(String flag, String id, List<String> vipFlags) {
|
||||
if (id.startsWith("http") && id.contains("***")) id = id.replace("***", "#");
|
||||
if (id.contains("://") && id.contains("***")) id = id.replace("***", "#");
|
||||
if (flag.equals("直連")) return Result.get().url(id).subs(getSubs(id)).string();
|
||||
if (flag.equals("解析")) return Result.get().parse().jx().url(id).string();
|
||||
if (flag.equals("嗅探")) return Result.get().parse().url(id).string();
|
||||
|
|
@ -39,7 +39,7 @@ public class Push extends Spider {
|
|||
vod.setVodPic(Image.PUSH);
|
||||
vod.setTypeName("FongMi");
|
||||
vod.setVodName(url.startsWith("file://") ? new File(url).getName() : url);
|
||||
if (url.startsWith("http") && url.contains("#")) url = url.replace("#", "***");
|
||||
if (url.contains("://") && url.contains("#")) url = url.replace("#", "***");
|
||||
if (Util.isThunder(url)) {
|
||||
vod.setVodPlayUrl(url);
|
||||
vod.setVodPlayFrom("迅雷");
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
5ff6b67b0a828c1a512c9df7c0d1e626
|
||||
65a8a861fbc445ee153d9e0064aabedc
|
||||
|
|
|
|||
Loading…
Reference in New Issue