Small fixes
authorNiki Roo <niki@nikiroo.be>
Mon, 13 Feb 2017 05:53:55 +0000 (06:53 +0100)
committerNiki Roo <niki@nikiroo.be>
Mon, 13 Feb 2017 05:53:55 +0000 (06:53 +0100)
"©Author" replaced by "By Author" in text format
UPDATING/UPDATED debug messages removed
Fix cause of "null: .... imported." (LUID not found) when importing to
  library: the MetaData object was not updated back into the story

src/be/nikiroo/fanfix/Instance.java
src/be/nikiroo/fanfix/Library.java
src/be/nikiroo/fanfix/bundles/resources.properties
src/be/nikiroo/fanfix/output/Text.java
src/be/nikiroo/fanfix/supported/InfoText.java

index 91902c3ba7b02494c0ee340b433be123263464ca..9c20682fd8d6798da64eea8406ddfc86fa1c9dee 100644 (file)
@@ -47,9 +47,7 @@ public class Instance {
                        }
                        try {
                                trans = new StringIdBundle(getLang());
                        }
                        try {
                                trans = new StringIdBundle(getLang());
-                               System.out.println("UPDATING");
                                trans.updateFile(configDir);
                                trans.updateFile(configDir);
-                               System.out.println("UPDATED");
                        } catch (IOException e) {
                                syserr(e);
                        }
                        } catch (IOException e) {
                                syserr(e);
                        }
index abe760b0d24e31862764093be7bdbcf0b670ce0d..68f93c5385c66ea52c7f4bd2fd6d43eb8ed8bb3b 100644 (file)
@@ -227,7 +227,9 @@ public class Library {
         *             in case of I/O error
         */
        private Story save(Story story, String luid) throws IOException {
         *             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();
                MetaData key = story.getMeta().clone();
+               story.setMeta(key);
 
                if (luid == null || luid.isEmpty()) {
                        getStories(); // refresh lastId if needed
 
                if (luid == null || luid.isEmpty()) {
                        getStories(); // refresh lastId if needed
index c835624a8e2d061886ca69ea507002a3bcd9398e..035594f6728299d9fc4702ed23cf7221bd422179 100644 (file)
@@ -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
 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
index 6db7b7be8d3f4ee53395345acd61a29ba802181b..4555ce621f68816ec9271681497476042897b7fc 100644 (file)
@@ -59,7 +59,8 @@ class Text extends BasicOutput {
                writer.write(title);
                writer.write("\n");
                if (author != null && !author.isEmpty()) {
                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(" (");
                }
                if (date != null && !date.isEmpty()) {
                        writer.write(" (");
index 4f1dc39df95fae4ed24cf51f2908bc741813e947..8d4d97d935dc4ed263c80b20a836c790bcf683bd 100644 (file)
@@ -30,10 +30,11 @@ class InfoText extends Text {
                        MetaData meta = InfoReader.readMeta(new File(new File(source
                                        .toURI()).getPath() + ".info"));
 
                        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();
                        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()) {
                        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.getDate() == null || meta.getDate().isEmpty()) {
                                        meta.setDate(superMeta.getDate());
                                }
+                               if (meta.getUrl() == null || meta.getUrl().isEmpty()) {
+                                       meta.setUrl(superMeta.getUrl());
+                               }
                        }
 
                        return meta;
                        }
 
                        return meta;