X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Flibrary%2FBasicLibrary.java;h=c558384d380526819f36a8dac9553b89d33517ca;hb=d66deb8d8b30cff6b54db352eef34a3508939f84;hp=380c5c988ca43dad853f7e4edb25e657a55ed1ba;hpb=0c7a66371e9fbf37a5348df63ed1b6dac32142f8;p=nikiroo-utils.git diff --git a/src/be/nikiroo/fanfix/library/BasicLibrary.java b/src/be/nikiroo/fanfix/library/BasicLibrary.java index 380c5c9..c558384 100644 --- a/src/be/nikiroo/fanfix/library/BasicLibrary.java +++ b/src/be/nikiroo/fanfix/library/BasicLibrary.java @@ -730,10 +730,8 @@ abstract public class BasicLibrary { } catch (IOException e) { // We should not have not-supported files in the // library - Instance.getTraceHandler().error( - new IOException(String.format( - "Cannot load file of type '%s' from library: %s", - meta.getType(), file), e)); + Instance.getInstance().getTraceHandler().error(new IOException( + String.format("Cannot load file of type '%s' from library: %s", meta.getType(), file), e)); } finally { pgProcess.done(); pg.done(); @@ -751,14 +749,14 @@ abstract public class BasicLibrary { * @param pg * the optional progress reporter * - * @return the imported {@link Story} + * @return the imported Story {@link MetaData} * * @throws UnknownHostException * if the host is not supported * @throws IOException * in case of I/O error */ - public Story imprt(URL url, Progress pg) throws IOException { + public MetaData imprt(URL url, Progress pg) throws IOException { if (pg == null) pg = new Progress(); @@ -776,7 +774,7 @@ abstract public class BasicLibrary { Story story = save(support.process(pgProcess), pgSave); pg.done(); - return story; + return story.getMeta(); } /** @@ -892,8 +890,7 @@ abstract public class BasicLibrary { public synchronized Story save(Story story, String luid, Progress pg) throws IOException { - Instance.getTraceHandler().trace( - this.getClass().getSimpleName() + ": saving story " + luid); + 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(); @@ -913,9 +910,8 @@ abstract public class BasicLibrary { updateInfo(story.getMeta()); - Instance.getTraceHandler().trace( - this.getClass().getSimpleName() + ": story saved (" + luid - + ")"); + Instance.getInstance().getTraceHandler() + .trace(this.getClass().getSimpleName() + ": story saved (" + luid + ")"); return story; } @@ -930,14 +926,13 @@ abstract public class BasicLibrary { * in case of I/O error */ public synchronized void delete(String luid) throws IOException { - Instance.getTraceHandler().trace( - this.getClass().getSimpleName() + ": deleting story " + luid); + Instance.getInstance().getTraceHandler().trace(this.getClass().getSimpleName() + ": deleting story " + luid); doDelete(luid); invalidateInfo(luid); - Instance.getTraceHandler().trace( - this.getClass().getSimpleName() + ": story deleted (" + luid + Instance.getInstance().getTraceHandler() + .trace(this.getClass().getSimpleName() + ": story deleted (" + luid + ")"); }