From: Niki Roo Date: Sun, 12 May 2019 14:52:30 +0000 (+0200) Subject: fix DataLoader (!) X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=c289a297c0e819c9c944732e52e30a35db7a1796;p=nikiroo-utils.git fix DataLoader (!) --- diff --git a/src/be/nikiroo/fanfix/DataLoader.java b/src/be/nikiroo/fanfix/DataLoader.java index 51855c4..abc9585 100644 --- a/src/be/nikiroo/fanfix/DataLoader.java +++ b/src/be/nikiroo/fanfix/DataLoader.java @@ -238,7 +238,7 @@ public class DataLoader { */ public void refresh(URL url, BasicSupport support, boolean stable) throws IOException { - if (check(url, stable)) { + if (!check(url, stable)) { open(url, url, support, stable, null, null, null).close(); } } diff --git a/src/be/nikiroo/fanfix/data/MetaData.java b/src/be/nikiroo/fanfix/data/MetaData.java index 67fedbd..1781d86 100644 --- a/src/be/nikiroo/fanfix/data/MetaData.java +++ b/src/be/nikiroo/fanfix/data/MetaData.java @@ -5,6 +5,7 @@ import java.util.ArrayList; import java.util.List; import be.nikiroo.utils.Image; +import be.nikiroo.utils.StringUtils; /** * The meta data associated to a {@link Story} object. @@ -469,19 +470,8 @@ public class MetaData implements Cloneable, Comparable, Serializable { String cover = "none"; if (getCover() != null) { - cover = " bytes"; - - int size = getCover().getData().length; - if (size > 1000) { - size /= 1000; - cover = " kb"; - if (size > 1000) { - size /= 1000; - cover = " mb"; - } - } - - cover = size + cover; + cover = StringUtils.formatNumber(getCover().getData().length) + + "bytes"; } return String.format( diff --git a/src/be/nikiroo/fanfix/supported/BasicSupport_Deprecated.java b/src/be/nikiroo/fanfix/supported/BasicSupport_Deprecated.java index f8ea9d4..d1dbc00 100644 --- a/src/be/nikiroo/fanfix/supported/BasicSupport_Deprecated.java +++ b/src/be/nikiroo/fanfix/supported/BasicSupport_Deprecated.java @@ -681,7 +681,6 @@ public abstract class BasicSupport_Deprecated extends BasicSupport { // try for files if (source != null) { try { - String relPath = null; String absPath = null; try { diff --git a/src/be/nikiroo/fanfix/supported/Cbz.java b/src/be/nikiroo/fanfix/supported/Cbz.java index 3da65ee..3682afe 100644 --- a/src/be/nikiroo/fanfix/supported/Cbz.java +++ b/src/be/nikiroo/fanfix/supported/Cbz.java @@ -1,7 +1,6 @@ package be.nikiroo.fanfix.supported; import java.io.File; -import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.net.URL; @@ -21,8 +20,8 @@ import be.nikiroo.fanfix.data.Paragraph.ParagraphType; import be.nikiroo.fanfix.data.Story; import be.nikiroo.utils.IOUtils; import be.nikiroo.utils.Image; -import be.nikiroo.utils.streams.MarkableFileInputStream; import be.nikiroo.utils.Progress; +import be.nikiroo.utils.streams.MarkableFileInputStream; /** * Support class for CBZ files (works better with CBZ created with this program,