From c747c1f2b4225bc600d25d8ebef7b45e3cf6e7c7 Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Thu, 19 Sep 2019 14:11:39 +0200 Subject: [PATCH] fix imported stories don't appear on screen --- changelog-fr.md | 1 + changelog.md | 1 + src/be/nikiroo/fanfix/library/CacheLibrary.java | 8 +++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/changelog-fr.md b/changelog-fr.md index 5ea8c32..98ac187 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 195310b..7d4e9a9 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 e128da5..e8743b6 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; } -- 2.27.0