package be.nikiroo.fanfix.library;
-import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import be.nikiroo.fanfix.output.BasicOutput.OutputType;
import be.nikiroo.fanfix.supported.BasicSupport;
import be.nikiroo.fanfix.supported.BasicSupport.SupportType;
+import be.nikiroo.utils.Image;
import be.nikiroo.utils.Progress;
/**
*
* @return the cover image
*/
- public abstract BufferedImage getCover(String luid);
+ public abstract Image getCover(String luid);
/**
* Return the cover image associated to this source.
*
* @return the cover image or NULL
*/
- public BufferedImage getSourceCover(String source) {
+ public Image getSourceCover(String source) {
List<MetaData> metas = getListBySource(source);
if (metas.size() > 0) {
return getCover(metas.get(0).getLuid());
* Invalidate the {@link Story} cache (when the content should be re-read
* because it was changed).
*/
- protected abstract void clearCache();
+ protected void invalidateInfo() {
+ invalidateInfo(null);
+ }
+
+ /**
+ * Invalidate the {@link Story} cache (when the content should be re-read
+ * because it was changed).
+ *
+ * @param luid
+ * the luid of the {@link Story} to clear from the cache, or NULL
+ * for all stories
+ */
+ protected abstract void invalidateInfo(String luid);
/**
* Return the next LUID that can be used.
meta.setLuid(luid);
}
- if (getInfo(luid) != null) {
+ if (luid != null && getInfo(luid) != null) {
delete(luid);
}
doSave(story, pg);
- clearCache();
+ invalidateInfo(luid);
return story;
}
*/
public synchronized void delete(String luid) throws IOException {
doDelete(luid);
- clearCache();
+ invalidateInfo(luid);
}
/**