parent
f38b9850fc
commit
26efcd99d1
|
|
@ -32,6 +32,14 @@ public class Result {
|
||||||
private int parse;
|
private int parse;
|
||||||
@SerializedName("jx")
|
@SerializedName("jx")
|
||||||
private int jx;
|
private int jx;
|
||||||
|
@SerializedName("page")
|
||||||
|
private int Page;
|
||||||
|
@SerializedName("pagecount")
|
||||||
|
private int PageCount;
|
||||||
|
@SerializedName("limit")
|
||||||
|
private int Limit;
|
||||||
|
@SerializedName("total")
|
||||||
|
private int Total;
|
||||||
|
|
||||||
public static String string(List<Class> classes, List<Vod> list, LinkedHashMap<String, List<Filter>> filters) {
|
public static String string(List<Class> classes, List<Vod> list, LinkedHashMap<String, List<Filter>> filters) {
|
||||||
return Result.get().classes(classes).vod(list).filters(filters).string();
|
return Result.get().classes(classes).vod(list).filters(filters).string();
|
||||||
|
|
@ -137,4 +145,28 @@ public class Result {
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new Gson().toJson(this);
|
return new Gson().toJson(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Result pageSetup(int Page, int PageCount, int Limit, int Total) {
|
||||||
|
if (Page > 0) {
|
||||||
|
this.Page = Page;
|
||||||
|
} else {
|
||||||
|
this.Page = Integer.MAX_VALUE;
|
||||||
|
}
|
||||||
|
if (PageCount > 0) {
|
||||||
|
this.PageCount = PageCount;
|
||||||
|
} else {
|
||||||
|
this.PageCount = Integer.MAX_VALUE;
|
||||||
|
}
|
||||||
|
if (Limit > 0) {
|
||||||
|
this.Limit = Limit;
|
||||||
|
} else {
|
||||||
|
this.Limit = Integer.MAX_VALUE;
|
||||||
|
}
|
||||||
|
if (Total > 0) {
|
||||||
|
this.Total = Total;
|
||||||
|
} else {
|
||||||
|
this.Total = Integer.MAX_VALUE;
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.github.catvod.bean.ali;
|
||||||
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.github.catvod.utils.Misc;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
|
@ -26,6 +27,8 @@ public class Item {
|
||||||
private String fileExtension;
|
private String fileExtension;
|
||||||
@SerializedName("category")
|
@SerializedName("category")
|
||||||
private String category;
|
private String category;
|
||||||
|
@SerializedName("size")
|
||||||
|
private double size;
|
||||||
|
|
||||||
public static Item objectFrom(String str) {
|
public static Item objectFrom(String str) {
|
||||||
return new Gson().fromJson(str, Item.class);
|
return new Gson().fromJson(str, Item.class);
|
||||||
|
|
@ -67,11 +70,11 @@ public class Item {
|
||||||
return TextUtils.isEmpty(category) ? "" : category;
|
return TextUtils.isEmpty(category) ? "" : category;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDisplayName(String fileName) {
|
public String getDisplayName(String fileName, String size) { return getSize().isEmpty() ? "[" + size + "]" + fileName : fileName; }
|
||||||
return getName().isEmpty() ? fileName : "[" + getName() + "] " + fileName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String removeExt() {
|
public String removeExt() {
|
||||||
return getName().indexOf(".") > 0 ? getName().substring(0, getName().lastIndexOf(".")) : getName();
|
return getName().indexOf(".") > 0 ? getName().substring(0, getName().lastIndexOf(".")) : getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getSize() { return TextUtils.isEmpty(Misc.getSize(size)) ? "" : Misc.getSize(size); }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,7 @@ public class AList extends Spider {
|
||||||
Sorter.sort(type, order, files);
|
Sorter.sort(type, order, files);
|
||||||
for (Item item : folders) list.add(item.getVod(tid));
|
for (Item item : folders) list.add(item.getVod(tid));
|
||||||
for (Item item : files) list.add(item.getVod(tid));
|
for (Item item : files) list.add(item.getVod(tid));
|
||||||
return Result.string(list);
|
return Result.get().vod(list).pageSetup(1, 1, 0, 1).string();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,7 @@ public class Ali {
|
||||||
if (file.getType().equals("folder")) {
|
if (file.getType().equals("folder")) {
|
||||||
folders.add(file);
|
folders.add(file);
|
||||||
} else if (file.getCategory().equals("video") || file.getCategory().equals("audio")) {
|
} else if (file.getCategory().equals("video") || file.getCategory().equals("audio")) {
|
||||||
name2id.put(parent.getDisplayName(file.getName()), shareId + "+" + shareToken + "+" + file.getFileId());
|
name2id.put(parent.getDisplayName(file.getName(), file.getSize()), shareId + "+" + shareToken + "+" + file.getFileId());
|
||||||
} else if (Misc.isSub(file.getExt())) {
|
} else if (Misc.isSub(file.getExt())) {
|
||||||
String key = file.removeExt();
|
String key = file.removeExt();
|
||||||
if (!subMap.containsKey(key)) subMap.put(key, new ArrayList<>());
|
if (!subMap.containsKey(key)) subMap.put(key, new ArrayList<>());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue