Fix gallery restore
SpiderInfo has changed, but restore code was the old version
This commit is contained in:
1 parent
1edf98c9e1
commit
b0a5666a6d
2 files changed
+11
-11
No files matched your search
@@ -31,6 +31,7 @@ import com.hippo.ehviewer.Settings;
|
||||
import com.hippo.ehviewer.client.EhEngine;
|
||||
import com.hippo.ehviewer.client.data.GalleryInfo;
|
||||
import com.hippo.ehviewer.download.DownloadManager;
|
||||
import com.hippo.ehviewer.spider.SpiderInfo;
|
||||
import com.hippo.ehviewer.spider.SpiderQueen;
|
||||
import com.hippo.unifile.UniFile;
|
||||
import com.hippo.yorozuya.IOUtils;
|
||||
@@ -88,13 +89,12 @@ public class RestoreDownloadPreference extends TaskPreference {
|
||||
InputStream is = null;
|
||||
try {
|
||||
is = siFile.openInputStream();
|
||||
// Skip start page
|
||||
IOUtils.readAsciiLine(is);
|
||||
long gid = Long.parseLong(IOUtils.readAsciiLine(is));
|
||||
SpiderInfo spiderInfo = SpiderInfo.read(is);
|
||||
long gid = spiderInfo.gid;
|
||||
if (mManager.containDownloadInfo(gid)) {
|
||||
return null;
|
||||
}
|
||||
String token = IOUtils.readAsciiLine(is);
|
||||
String token = spiderInfo.token;
|
||||
RestoreItem restoreItem = new RestoreItem();
|
||||
restoreItem.gid = gid;
|
||||
restoreItem.token = token;
|
||||
|
||||
@@ -40,13 +40,13 @@ public class SpiderInfo {
|
||||
|
||||
static final String TOKEN_FAILED = "failed";
|
||||
|
||||
int startPage = 0;
|
||||
long gid = -1;
|
||||
String token = null;
|
||||
int pages = -1;
|
||||
int previewPages = -1;
|
||||
int previewPerPage = -1;
|
||||
SparseArray<String> pTokenMap = null;
|
||||
public int startPage = 0;
|
||||
public long gid = -1;
|
||||
public String token = null;
|
||||
public int pages = -1;
|
||||
public int previewPages = -1;
|
||||
public int previewPerPage = -1;
|
||||
public SparseArray<String> pTokenMap = null;
|
||||
|
||||
public static SpiderInfo read(@Nullable UniFile file) {
|
||||
if (file == null) {
|
||||
|
||||
Reference in new issue
Block a user