From: Niki Roo Date: Thu, 19 Sep 2019 12:11:39 +0000 (+0200) Subject: fix imported stories don't appear on screen X-Git-Tag: fanfix-swing-0.0.1~12^2~42^2~2 X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=c747c1f2b4225bc600d25d8ebef7b45e3cf6e7c7;p=fanfix-swing.git fix imported stories don't appear on screen --- diff --git a/changelog-fr.md b/changelog-fr.md index 5ea8c329..98ac1870 100644 --- a/changelog-fr.md +++ b/changelog-fr.md @@ -7,6 +7,7 @@ - new: support d'un proxy - fix: support des CBZ contenant du texte - fix: correction de DEBUG=0 +- fix: correction des histoires importées qui n'arrivent pas immédiatement à l'affichage - gui: correction pour le focus - gui: fix pour la couleur d'arrière plan - gui: fix pour la navigation au clavier (haut et bas) diff --git a/changelog.md b/changelog.md index 195310b3..7d4e9a9d 100644 --- a/changelog.md +++ b/changelog.md @@ -7,6 +7,7 @@ - new: proxy support - fix: support hybrid CBZ (with text) - fix: fix DEBUG=0 +- fix: fix imported stories that don't immediatly appear on screen - gui: focus fix - gui: bg colour fix - gui: fix keyboard navigation support (up and down) diff --git a/src/be/nikiroo/fanfix/library/CacheLibrary.java b/src/be/nikiroo/fanfix/library/CacheLibrary.java index e128da52..e8743b63 100644 --- a/src/be/nikiroo/fanfix/library/CacheLibrary.java +++ b/src/be/nikiroo/fanfix/library/CacheLibrary.java @@ -216,11 +216,17 @@ public class CacheLibrary extends BasicLibrary { @Override protected void updateInfo(MetaData meta) throws IOException { if (meta != null && metas != null) { + boolean changed = false; for (int i = 0; i < metas.size(); i++) { if (metas.get(i).getLuid().equals(meta.getLuid())) { metas.set(i, meta); + changed = true; } } + + if (!changed) { + metas.add(meta); + } } cacheLib.updateInfo(meta); @@ -360,7 +366,7 @@ public class CacheLibrary extends BasicLibrary { updateInfo(meta); clearFromCache(meta.getLuid()); - + pg.done(); return meta; }