From a7d266e6616349169d03e93780fb656754089dd0 Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Mon, 13 Feb 2017 06:53:55 +0100 Subject: [PATCH] =?utf8?q?Small=20fixes=20"=C2=A9Author"=20replaced=20by?= =?utf8?q?=20"By=20Author"=20in=20text=20format=20UPDATING/UPDATED=20debug?= =?utf8?q?=20messages=20removed=20Fix=20cause=20of=20"null:=20....=20impor?= =?utf8?q?ted."=20(LUID=20not=20found)=20when=20importing=20to=20=20=20lib?= =?utf8?q?rary:=20the=20MetaData=20object=20was=20not=20updated=20back=20i?= =?utf8?q?nto=20the=20story?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/be/nikiroo/fanfix/Instance.java | 2 -- src/be/nikiroo/fanfix/Library.java | 2 ++ src/be/nikiroo/fanfix/bundles/resources.properties | 3 +-- src/be/nikiroo/fanfix/output/Text.java | 3 ++- src/be/nikiroo/fanfix/supported/InfoText.java | 6 +++++- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/be/nikiroo/fanfix/Instance.java b/src/be/nikiroo/fanfix/Instance.java index 91902c3..9c20682 100644 --- a/src/be/nikiroo/fanfix/Instance.java +++ b/src/be/nikiroo/fanfix/Instance.java @@ -47,9 +47,7 @@ public class Instance { } try { trans = new StringIdBundle(getLang()); - System.out.println("UPDATING"); trans.updateFile(configDir); - System.out.println("UPDATED"); } catch (IOException e) { syserr(e); } diff --git a/src/be/nikiroo/fanfix/Library.java b/src/be/nikiroo/fanfix/Library.java index abe760b..68f93c5 100644 --- a/src/be/nikiroo/fanfix/Library.java +++ b/src/be/nikiroo/fanfix/Library.java @@ -227,7 +227,9 @@ public class Library { * in case of I/O error */ private Story save(Story story, String luid) throws IOException { + // Do not change the original metadata, but change the original story MetaData key = story.getMeta().clone(); + story.setMeta(key); if (luid == null || luid.isEmpty()) { getStories(); // refresh lastId if needed diff --git a/src/be/nikiroo/fanfix/bundles/resources.properties b/src/be/nikiroo/fanfix/bundles/resources.properties index c835624..035594f 100644 --- a/src/be/nikiroo/fanfix/bundles/resources.properties +++ b/src/be/nikiroo/fanfix/bundles/resources.properties @@ -133,5 +133,4 @@ OUTPUT_DESC_SYSOUT = A simple DEBUG console output LATEX_LANG_UNKNOWN = Unknown language: %s # (WHAT: 'by' prefix before author name) # used to output the author, make sure it is covered by Config.BYS for input detection -BY = © -BY_NOUTF = (c) +BY = By diff --git a/src/be/nikiroo/fanfix/output/Text.java b/src/be/nikiroo/fanfix/output/Text.java index 6db7b7b..4555ce6 100644 --- a/src/be/nikiroo/fanfix/output/Text.java +++ b/src/be/nikiroo/fanfix/output/Text.java @@ -59,7 +59,8 @@ class Text extends BasicOutput { writer.write(title); writer.write("\n"); if (author != null && !author.isEmpty()) { - writer.write("©" + author); + writer.write(Instance.getTrans().getString(StringId.BY) + " " + + author); } if (date != null && !date.isEmpty()) { writer.write(" ("); diff --git a/src/be/nikiroo/fanfix/supported/InfoText.java b/src/be/nikiroo/fanfix/supported/InfoText.java index 4f1dc39..8d4d97d 100644 --- a/src/be/nikiroo/fanfix/supported/InfoText.java +++ b/src/be/nikiroo/fanfix/supported/InfoText.java @@ -30,10 +30,11 @@ class InfoText extends Text { MetaData meta = InfoReader.readMeta(new File(new File(source .toURI()).getPath() + ".info")); - // Some old .info files don't have this information... + // Some old .info files don't have those now required fields... String test = meta.getTitle() == null ? "" : meta.getTitle(); test += meta.getAuthor() == null ? "" : meta.getAuthor(); test += meta.getDate() == null ? "" : meta.getDate(); + test += meta.getUrl() == null ? "" : meta.getUrl(); if (test.isEmpty()) { MetaData superMeta = super.getMeta(source, reset(in)); if (meta.getTitle() == null || meta.getTitle().isEmpty()) { @@ -45,6 +46,9 @@ class InfoText extends Text { if (meta.getDate() == null || meta.getDate().isEmpty()) { meta.setDate(superMeta.getDate()); } + if (meta.getUrl() == null || meta.getUrl().isEmpty()) { + meta.setUrl(superMeta.getUrl()); + } } return meta; -- 2.27.0