Update alist add playlist
This commit is contained in:
parent
bd02d7bfce
commit
728d4f72cb
|
|
@ -35,6 +35,14 @@ public class Item {
|
|||
return new Gson().fromJson(str, Item.class);
|
||||
}
|
||||
|
||||
public static Item playList(Item copy, String vodPic) {
|
||||
Item item = new Item();
|
||||
item.name = "播放列表";
|
||||
item.path = copy.path;
|
||||
item.thumb = vodPic;
|
||||
return item;
|
||||
}
|
||||
|
||||
public static List<Item> arrayFrom(String str) {
|
||||
Type listType = new TypeToken<List<Item>>() {}.getType();
|
||||
return new Gson().fromJson(str, listType);
|
||||
|
|
|
|||
|
|
@ -98,6 +98,9 @@ public class AList extends Spider {
|
|||
Sorter.sort(type, order, folders);
|
||||
Sorter.sort(type, order, files);
|
||||
}
|
||||
if (files.size() > 1) {
|
||||
folders.add(0, Item.playList(files.get(0), vodPic));
|
||||
}
|
||||
for (Item item : folders) list.add(item.getVod(tid, vodPic));
|
||||
for (Item item : files) list.add(item.getVod(tid, vodPic));
|
||||
return Result.get().vod(list).page().string();
|
||||
|
|
@ -107,18 +110,22 @@ public class AList extends Spider {
|
|||
public String detailContent(List<String> ids) throws Exception {
|
||||
fetchRule();
|
||||
String id = ids.get(0);
|
||||
boolean list = id.endsWith("播放列表");
|
||||
String key = id.contains("/") ? id.substring(0, id.indexOf("/")) : id;
|
||||
String path = id.substring(0, id.lastIndexOf("/"));
|
||||
String name = path.substring(path.lastIndexOf("/") + 1);
|
||||
Drive drive = getDrive(key);
|
||||
List<String> playUrls = new ArrayList<>();
|
||||
List<Item> parents = getList(path, false);
|
||||
Sorter.sort("name", "asc", parents);
|
||||
List<String> playUrls = new ArrayList<>();
|
||||
for (Item item : parents) {
|
||||
if (item.isMedia(drive.isNew())) {
|
||||
|
||||
if (list) {
|
||||
for (Item item : parents) if (item.isMedia(drive.isNew())) playUrls.add(item.getName() + "$" + item.getVodId(path) + findSubs(path, parents));
|
||||
} else {
|
||||
Item item = getDetail(id);
|
||||
playUrls.add(item.getName() + "$" + item.getVodId(path) + findSubs(path, parents));
|
||||
}
|
||||
}
|
||||
|
||||
Vod vod = new Vod();
|
||||
vod.setVodId(id);
|
||||
vod.setVodName(name);
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
a954689c65dff0bf8728a895798bb68a
|
||||
7871d4d3a51b5b0aa46b079b8104c2be
|
||||
|
|
|
|||
Loading…
Reference in New Issue