downloadCache.save(in, originalUrl);
// ..But we want a resetable stream
in.close();
- in = downloadCache.load(originalUrl, false, stable);
+ in = downloadCache.load(originalUrl, true, stable);
} else {
InputStream resetIn = IOUtils.forceResetableStream(in);
if (resetIn != in) {
@Override
protected void invalidateInfo(String luid) {
- List<MetaData> metas = this.metas;
-
if (luid == null) {
- this.metas = null;
+ metas = null;
} else if (metas != null) {
MetaData meta = lib.getInfo(luid);
for (int i = 0; i < metas.size(); i++) {
if (metas.get(i).getLuid().equals(luid)) {
- if (meta != null) {
- metas.set(i, meta);
- meta = null;
- } else {
- metas.remove(i--);
- }
+ metas.remove(i--);
}
}
}
lib.delete(luid);
- List<MetaData> metas = this.metas;
- if (metas != null) {
- for (int i = 0; i < metas.size(); i++) {
- if (metas.get(i).getLuid().equals(luid)) {
- metas.set(i, lib.getInfo(luid));
- }
- }
+ MetaData meta = getInfo(luid);
+ if (meta != null) {
+ metas.remove(meta);
}
}
Story story = lib.imprt(url, pgImprt);
cacheLib.save(story, story.getMeta().getLuid(), pgCache);
+ invalidateInfo(story.getMeta().getLuid());
+
pg.done();
return story;
}
if (chap.getValue() != null) {
setCurrentReferer(chap.getValue());
chapIn = Instance.getCache().open(chap.getValue(),
- this, true);
+ this, false);
}
pgChaps.setProgress(i * 100);
try {