X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Flibrary%2FLocalLibrary.java;h=54ad1d66769d8962cf5516a2bc5c6302e04e0ac6;hb=efa3c511f39ab1432675e3b75b9b7b32d579f1c3;hp=4cdfb944e0cd7b62bdbdedadac580cefa61f895b;hpb=b4f9071c1bd4534e9cca989f1e873310c94986c3;p=nikiroo-utils.git diff --git a/src/be/nikiroo/fanfix/library/LocalLibrary.java b/src/be/nikiroo/fanfix/library/LocalLibrary.java index 4cdfb94..54ad1d6 100644 --- a/src/be/nikiroo/fanfix/library/LocalLibrary.java +++ b/src/be/nikiroo/fanfix/library/LocalLibrary.java @@ -20,7 +20,6 @@ import be.nikiroo.fanfix.output.InfoCover; import be.nikiroo.fanfix.supported.InfoReader; import be.nikiroo.utils.IOUtils; import be.nikiroo.utils.Image; -import be.nikiroo.utils.MarkableFileInputStream; import be.nikiroo.utils.Progress; /** @@ -128,7 +127,12 @@ public class LocalLibrary extends BasicLibrary { } @Override - protected void invalidateInfo(String luid) { + protected synchronized void updateInfo(MetaData meta) { + deleteInfo(); + } + + @Override + protected void deleteInfo(String luid) { stories = null; sourceCovers = new HashMap(); } @@ -190,7 +194,7 @@ public class LocalLibrary extends BasicLibrary { } } - invalidateInfo(); + deleteInfo(); } @Override @@ -205,7 +209,7 @@ public class LocalLibrary extends BasicLibrary { @Override public void setSourceCover(String source, String luid) { sourceCovers.put(source, getCover(luid)); - File cover = new File(getExpectedDir(source), ".cover.png"); + File cover = new File(getExpectedDir(source), ".cover"); try { Instance.getCache().saveAsImage(sourceCovers.get(source), cover, true); @@ -262,7 +266,7 @@ public class LocalLibrary extends BasicLibrary { pg.add(1); } - invalidateInfo(); + deleteInfo(); pg.done(); return; } @@ -270,7 +274,7 @@ public class LocalLibrary extends BasicLibrary { super.imprt(other, luid, pg); - invalidateInfo(); + deleteInfo(); } /** @@ -405,7 +409,7 @@ public class LocalLibrary extends BasicLibrary { * {@link LocalLibrary#baseDir}. *

* Will use a cached list when possible (see - * {@link BasicLibrary#invalidateInfo()}). + * {@link BasicLibrary#deleteInfo()}). * * @param pg * the optional {@link Progress} @@ -468,10 +472,8 @@ public class LocalLibrary extends BasicLibrary { // not normal!! throw new IOException( "Cannot understand the LUID of " - + infoFile - + ": " - + (meta == null ? "[meta is NULL]" - : meta.getLuid()), e); + + infoFile + ": " + + meta.getLuid(), e); } } catch (IOException e) { // We should not have not-supported files in the @@ -519,7 +521,7 @@ public class LocalLibrary extends BasicLibrary { */ void setSourceCover(String source, Image coverImage) { sourceCovers.put(source, coverImage); - File cover = new File(getExpectedDir(source), ".cover.png"); + File cover = new File(getExpectedDir(source), ".cover"); try { Instance.getCache().saveAsImage(sourceCovers.get(source), cover, true);