X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Flibrary%2FCacheLibrary.java;h=28f568210bbcf137a1690989cad15fac50ae72e7;hb=0fa0fe9552e57bf05d8dd295a9d96d2364730c4e;hp=d653332a73673aaff0bbce6b0128cb901c15b94b;hpb=e06632eecd6d4b194c3dbe6322097ee61457ec33;p=fanfix.git diff --git a/src/be/nikiroo/fanfix/library/CacheLibrary.java b/src/be/nikiroo/fanfix/library/CacheLibrary.java index d653332..28f5682 100644 --- a/src/be/nikiroo/fanfix/library/CacheLibrary.java +++ b/src/be/nikiroo/fanfix/library/CacheLibrary.java @@ -45,6 +45,11 @@ public class CacheLibrary extends BasicLibrary { return lib.getLibraryName(); } + @Override + public Status getStatus() { + return lib.getStatus(); + } + @Override protected List getMetas(Progress pg) { if (pg == null) { @@ -80,7 +85,7 @@ public class CacheLibrary extends BasicLibrary { pgImport.done(); clearCache(); } catch (IOException e) { - Instance.syserr(e); + Instance.getTraceHandler().error(e); } pgImport.done(); @@ -126,8 +131,22 @@ public class CacheLibrary extends BasicLibrary { @Override public synchronized Story save(Story story, String luid, Progress pg) throws IOException { - story = lib.save(story, luid, pg); + Progress pgLib = new Progress(); + Progress pgCacheLib = new Progress(); + + if (pg == null) { + pg = new Progress(); + } + + pg.setMinMax(0, 2); + pg.addProgress(pgLib, 1); + pg.addProgress(pgCacheLib, 1); + + story = lib.save(story, luid, pgLib); + story = cacheLib.save(story, story.getMeta().getLuid(), pgCacheLib); + clearCache(); + return story; }