return custom;
}
- List<MetaData> metas = getListBySource(source);
+ List<MetaData> metas = getList().filter(source, null, null);
if (metas.size() > 0) {
return getCover(metas.get(0).getLuid());
}
return custom;
}
- List<MetaData> metas = getListByAuthor(author);
+ List<MetaData> metas = getList().filter(null, author, null);
if (metas.size() > 0) {
return getCover(metas.get(0).getLuid());
}
* @param pg
* the optional progress reporter
*/
- public void refresh(Progress pg) {
+ public synchronized void refresh(Progress pg) {
try {
getMetas(pg);
} catch (IOException e) {
* @throws IOException
* in case of IOException
*/
- public synchronized List<MetaData> getList() throws IOException {
- return getMetas(null);
- }
-
- /**
- * List all the stories of the given source type in the {@link BasicLibrary} ,
- * or all the stories if NULL is passed as a type.
- * <p>
- * Cover images not included.
- *
- * @param source the type of story to retrieve, or NULL for all
- *
- * @return the stories
- *
- * @throws IOException in case of IOException
- *
- * @deprecated use {@link BasicLibrary#getList(Progress)} and
- * {@link MetaResultList#filter(String, String, String)}
- */
- @Deprecated
- public synchronized List<MetaData> getListBySource(String source) throws IOException {
- return getList(null).filter(source, null, null);
- }
-
- /**
- * List all the stories of the given author in the {@link BasicLibrary}, or
- * all the stories if NULL is passed as an author.
- * <p>
- * Cover images not included.
- *
- * @param author
- * the author of the stories to retrieve, or NULL for all
- *
- * @return the stories
- *
- * @throws IOException
- * in case of IOException
- *
- * @deprecated use {@link BasicLibrary#getList(Progress)} and
- * {@link MetaResultList#filter(String, String, String)}
- */
- public synchronized List<MetaData> getListByAuthor(String author) throws IOException {
- return getList(null).filter(null, author, null);
+ public MetaResultList getList() throws IOException {
+ return getList(null);
}
/**
}
Story story = save(support.process(pgProcess), pgSave);
+ pg.setName(story.getMeta().getTitle());
pg.done();
return story.getMeta();
*/
public synchronized Story save(Story story, String luid, Progress pg)
throws IOException {
-
+ if (pg == null) {
+ pg = new Progress();
+ }
+
Instance.getInstance().getTraceHandler().trace(this.getClass().getSimpleName() + ": saving story " + luid);
// Do not change the original metadata, but change the original story
MetaData meta = story.getMeta().clone();
story.setMeta(meta);
+ pg.setName("Saving story");
+
if (luid == null || luid.isEmpty()) {
meta.setLuid(String.format("%03d", getNextId()));
} else {
Instance.getInstance().getTraceHandler()
.trace(this.getClass().getSimpleName() + ": story saved (" + luid + ")");
+ pg.setName(meta.getTitle());
+ pg.done();
return story;
}
meta.setTitle(newTitle);
meta.setAuthor(newAuthor);
saveMeta(meta, pg);
-
- invalidateInfo(luid);
}
/**