Add hidden config for alist

This commit is contained in:
FongMi 2023-08-17 23:44:44 +08:00
parent f0c3cee1b5
commit ee7d591797
7 changed files with 13 additions and 5 deletions

View File

@ -37,6 +37,8 @@ public class Drive {
private String token; private String token;
@SerializedName("search") @SerializedName("search")
private Boolean search; private Boolean search;
@SerializedName("hidden")
private Boolean hidden;
public static Drive objectFrom(String str) { public static Drive objectFrom(String str) {
return new Gson().fromJson(str, Drive.class); return new Gson().fromJson(str, Drive.class);
@ -98,6 +100,10 @@ public class Drive {
return search == null || search; return search == null || search;
} }
public Boolean hidden() {
return hidden != null && hidden;
}
public boolean isNew() { public boolean isNew() {
return getVersion() == 3; return getVersion() == 3;
} }

View File

@ -81,7 +81,7 @@ public class AList extends Spider {
fetchRule(); fetchRule();
List<Class> classes = new ArrayList<>(); List<Class> classes = new ArrayList<>();
LinkedHashMap<String, List<Filter>> filters = new LinkedHashMap<>(); LinkedHashMap<String, List<Filter>> filters = new LinkedHashMap<>();
for (Drive drive : drives) classes.add(drive.toType()); for (Drive drive : drives) if (!drive.hidden()) classes.add(drive.toType());
for (Class item : classes) filters.put(item.getTypeId(), getFilter()); for (Class item : classes) filters.put(item.getTypeId(), getFilter());
return Result.string(classes, filters); return Result.string(classes, filters);
} }

Binary file not shown.

View File

@ -1 +1 @@
60e553db98f40a31024cbac397528fde e9ee25066054dee3891e754f566281b7

View File

@ -1,5 +1,5 @@
{ {
"spider": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;60e553db98f40a31024cbac397528fde", "spider": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;e9ee25066054dee3891e754f566281b7",
"wallpaper": "https://gao.chuqiuyu.tk", "wallpaper": "https://gao.chuqiuyu.tk",
"sites": [ "sites": [
{ {

View File

@ -3,7 +3,8 @@
"drives": [ "drives": [
{ {
"name": "小雅", "name": "小雅",
"server": "http://alist.xiaoya.pro" "server": "http://alist.xiaoya.pro",
"search": false
}, },
{ {
"name": "觸光", "name": "觸光",
@ -28,6 +29,7 @@
{ {
"name": "範本", "name": "範本",
"server": "https://one.fongmi.com", "server": "https://one.fongmi.com",
"hidden": true,
"login": { "login": {
"username": "fongmi", "username": "fongmi",
"password": "fongmi" "password": "fongmi"

View File

@ -1,5 +1,5 @@
{ {
"spider": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;60e553db98f40a31024cbac397528fde", "spider": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;e9ee25066054dee3891e754f566281b7",
"wallpaper": "http://饭太硬.top/深色壁纸/api.php", "wallpaper": "http://饭太硬.top/深色壁纸/api.php",
"sites": [ "sites": [
{ {