Fix alist

This commit is contained in:
FongMi 2022-11-30 23:15:24 +08:00
parent 8387c423b6
commit 42fa76afef
3 changed files with 8 additions and 4 deletions

View File

@ -47,12 +47,16 @@ public class AList extends Spider {
drives = Drive.objectFrom(ext).getDrives(); drives = Drive.objectFrom(ext).getDrives();
} }
private Drive getDrive(String name) { private Drive checkVersion(Drive drive) {
Drive drive = drives.get(drives.indexOf(new Drive(name)));
if (drive.getVersion() == 0) drive.setVersion(OkHttpUtil.string(drive.settingsApi()).contains("v3.") ? 3 : 2); if (drive.getVersion() == 0) drive.setVersion(OkHttpUtil.string(drive.settingsApi()).contains("v3.") ? 3 : 2);
return drive; return drive;
} }
private Drive getDrive(String name) {
Drive drive = drives.get(drives.indexOf(new Drive(name)));
return checkVersion(drive);
}
@Override @Override
public void init(Context context, String extend) { public void init(Context context, String extend) {
try { try {
@ -121,7 +125,7 @@ public class AList extends Spider {
fetchRule(); fetchRule();
List<Vod> list = new ArrayList<>(); List<Vod> list = new ArrayList<>();
CountDownLatch cd = new CountDownLatch(drives.size()); CountDownLatch cd = new CountDownLatch(drives.size());
for (Drive drive : drives) new Thread(() -> search(cd, list, drive, keyword)).start(); for (Drive drive : drives) new Thread(() -> search(cd, list, checkVersion(drive), keyword)).start();
cd.await(); cd.await();
return Result.string(list); return Result.string(list);
} }

Binary file not shown.

View File

@ -1 +1 @@
aa1aaf2c71abcb2b2da5db8301c1e3da 4c2c569b1472f4e040ebc6a2de961864