public Image getCover(String luid) throws IOException {
InputStream in = post(WebLibraryUrls.getStoryUrlCover(luid));
try {
- return new Image(in);
+ Image img = new Image(in);
+ if (img.getSize() > 0) {
+ return img;
+ }
+
+ return null;
} finally {
in.close();
}
public Image getCustomSourceCover(String source) throws IOException {
InputStream in = post(WebLibraryUrls.getCoverUrlSource(source));
try {
- return new Image(in);
+ Image img = new Image(in);
+ if (img.getSize() > 0) {
+ return img;
+ }
+
+ return null;
} finally {
in.close();
}
public Image getCustomAuthorCover(String author) throws IOException {
InputStream in = post(WebLibraryUrls.getCoverUrlAuthor(author));
try {
- return new Image(in);
+ Image img = new Image(in);
+ if (img.getSize() > 0) {
+ return img;
+ }
+
+ return null;
} finally {
in.close();
}
InputStream subin = post(
WebLibraryUrls.getStoryUrl(luid, chapNum, number));
try {
- para.setContentImage(new Image(subin));
+ Image img = new Image(subin);
+ if (img.getSize() > 0) {
+ para.setContentImage(img);
+ }
} finally {
subin.close();
}
try {
subPg = JsonIO.toProgress(
new JSONObject(IOUtils.readSmallStream(in)));
+ pg.setName(subPg.getName());
+ pg.setMinMax(subPg.getMin(), subPg.getMax());
+ pg.setProgress(subPg.getProgress());
+ } catch (Exception e) {
+ subPg = null;
} finally {
in.close();
}
}
}
+ @Override
+ public synchronized void delete(String luid) throws IOException {
+ post(WebLibraryUrls.getDeleteUrlStory(luid), null).close();
+ }
+
@Override
protected void updateInfo(MetaData meta) {
// Will be taken care of directly server side