keep publisher on re-import
authorNiki Roo <niki@nikiroo.be>
Thu, 21 May 2020 11:36:13 +0000 (13:36 +0200)
committerNiki Roo <niki@nikiroo.be>
Thu, 21 May 2020 11:36:13 +0000 (13:36 +0200)
src/be/nikiroo/fanfix/data/MetaData.java
src/be/nikiroo/fanfix/supported/BasicSupport.java
src/be/nikiroo/fanfix/supported/BasicSupport_Deprecated.java

index 1c6ad42838d5541dbd69533b9fb1e2d21d52dd60..5989604ce92f51edef0b631a45dcec1ff0200ab6 100644 (file)
@@ -320,7 +320,7 @@ public class MetaData implements Cloneable, Comparable<MetaData>, Serializable {
         * output type this {@link Story} is in (see {@link SupportType}).
         * <p>
         * It allows you to know where the {@link Story} comes from, and is not
-        * supposed to change.
+        * supposed to change, even when re-imported.
         * <p>
         * It's the user representation of the enum
         * ({@link SupportType#getSourceName()}, not
@@ -337,7 +337,7 @@ public class MetaData implements Cloneable, Comparable<MetaData>, Serializable {
         * output type this {@link Story} is in (see {@link SupportType}).
         * <p>
         * It allows you to know where the {@link Story} comes from, and is not
-        * supposed to change.
+        * supposed to change, even when re-imported.
         * <p>
         * It's the user representation of the enum
         * ({@link SupportType#getSourceName()}, not
@@ -353,8 +353,8 @@ public class MetaData implements Cloneable, Comparable<MetaData>, Serializable {
        /**
         * The output type this {@link Story} is in (see {@link SupportType}).
         * <p>
-        * It allows you to know where the {@link Story} comes from, and is not
-        * supposed to change.
+        * It allows you to know where the {@link Story} comes from, and is supposed
+        * to only change when it is imported anew.
         * <p>
         * It's the direct representation of the enum
         * ({@link SupportType#toString()}, not
@@ -369,8 +369,8 @@ public class MetaData implements Cloneable, Comparable<MetaData>, Serializable {
        /**
         * The output type this {@link Story} is in (see {@link SupportType}).
         * <p>
-        * It allows you to know where the {@link Story} comes from, and is not
-        * supposed to change.
+        * It allows you to know where the {@link Story} comes from, and is supposed
+        * to only change when it is imported anew.
         * <p>
         * It's the direct representation of the enum
         * ({@link SupportType#toString()}, not
index bcfcca1bdbb16cfd3bd8849e8fdb2bfb55a22de0..ff9ecaf9be3cc80666d964ee48da375d1307bae6 100644 (file)
@@ -276,8 +276,10 @@ public abstract class BasicSupport {
                MetaData meta = getMeta();
                meta.setType(getType().toString());
                meta.setSource(getType().getSourceName());
-               meta.setPublisher(getType().getSourceName());
-               
+               if (meta.getPublisher() == null) {
+                       meta.setPublisher(getType().getSourceName());
+               }
+
                if (meta.getCreationDate() == null
                                || meta.getCreationDate().trim().isEmpty()) {
                        meta.setCreationDate(bsHelper
index 9aac6d5c61b713a4641fc251796b981e48d3a2ec..512aabf390d8cf9a9aa07fcf692a491249510d2e 100644 (file)
@@ -207,7 +207,9 @@ public abstract class BasicSupport_Deprecated extends BasicSupport {
                        MetaData meta = getMeta(url, getInput());
                        meta.setType(getType().toString());
                        meta.setSource(getType().getSourceName());
-                       meta.setPublisher(getType().getSourceName());
+                       if (meta.getPublisher() == null) {
+                               meta.setPublisher(getType().getSourceName());
+                       }
                        
                        if (meta.getCreationDate() == null
                                        || meta.getCreationDate().trim().isEmpty()) {