}
@Override
- protected List<MetaData> getMetas(Progress pg) {
+ protected List<MetaData> getMetas(Progress pg) throws IOException {
if (pg == null) {
pg = new Progress();
}
}
@Override
- public synchronized Story getStory(String luid, MetaData meta, Progress pg) {
+ public synchronized MetaData getInfo(String luid) throws IOException {
+ MetaData info = cacheLib.getInfo(luid);
+ if (info == null) {
+ info = lib.getInfo(luid);
+ }
+
+ return info;
+ }
+
+ @Override
+ public synchronized Story getStory(String luid, MetaData meta, Progress pg)
+ throws IOException {
if (pg == null) {
pg = new Progress();
}
}
@Override
- public synchronized File getFile(final String luid, Progress pg) {
+ public synchronized File getFile(final String luid, Progress pg)
+ throws IOException {
if (pg == null) {
pg = new Progress();
}
}
@Override
- public Image getCover(final String luid) {
+ public Image getCover(final String luid) throws IOException {
if (isCached(luid)) {
return cacheLib.getCover(luid);
}
}
@Override
- public Image getSourceCover(String source) {
+ public Image getSourceCover(String source) throws IOException {
Image custom = getCustomSourceCover(source);
if (custom != null) {
return custom;
}
@Override
- public Image getAuthorCover(String author) {
+ public Image getAuthorCover(String author) throws IOException {
Image custom = getCustomAuthorCover(author);
if (custom != null) {
return custom;
}
@Override
- public Image getCustomSourceCover(String source) {
+ public Image getCustomSourceCover(String source) throws IOException {
Image custom = cacheLib.getCustomSourceCover(source);
if (custom == null) {
custom = lib.getCustomSourceCover(source);
}
@Override
- public Image getCustomAuthorCover(String author) {
+ public Image getCustomAuthorCover(String author) throws IOException {
Image custom = cacheLib.getCustomAuthorCover(author);
if (custom == null) {
custom = lib.getCustomAuthorCover(author);
}
@Override
- public void setSourceCover(String source, String luid) {
+ public void setSourceCover(String source, String luid) throws IOException {
lib.setSourceCover(source, luid);
cacheLib.setSourceCover(source, getCover(luid));
}
@Override
- public void setAuthorCover(String author, String luid) {
+ public void setAuthorCover(String author, String luid) throws IOException {
lib.setAuthorCover(author, luid);
cacheLib.setAuthorCover(author, getCover(luid));
}
@Override
- protected void updateInfo(MetaData meta) {
+ protected void updateInfo(MetaData meta) throws IOException {
if (meta != null && metas != null) {
for (int i = 0; i < metas.size(); i++) {
if (metas.get(i).getLuid().equals(meta.getLuid())) {
}
lib.delete(luid);
- MetaData meta = getInfo(luid);
- if (meta != null) {
- metas.remove(meta);
- }
+ invalidateInfo(luid);
}
@Override
meta.setTitle(newTitle);
meta.setAuthor(newAuthor);
pg.done();
+
+ invalidateInfo(luid);
}
/**
* @return TRUE if it is
*/
public boolean isCached(String luid) {
- return cacheLib.getInfo(luid) != null;
+ try {
+ return cacheLib.getInfo(luid) != null;
+ } catch (IOException e) {
+ return false;
+ }
}
/**