From ee8686f095023b8cde2fc33488a58c291acfc50a Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Thu, 21 May 2020 13:36:13 +0200 Subject: [PATCH] keep publisher on re-import --- src/be/nikiroo/fanfix/data/MetaData.java | 12 ++++++------ src/be/nikiroo/fanfix/supported/BasicSupport.java | 6 ++++-- .../fanfix/supported/BasicSupport_Deprecated.java | 4 +++- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/be/nikiroo/fanfix/data/MetaData.java b/src/be/nikiroo/fanfix/data/MetaData.java index 1c6ad42..5989604 100644 --- a/src/be/nikiroo/fanfix/data/MetaData.java +++ b/src/be/nikiroo/fanfix/data/MetaData.java @@ -320,7 +320,7 @@ public class MetaData implements Cloneable, Comparable, Serializable { * output type this {@link Story} is in (see {@link SupportType}). *

* It allows you to know where the {@link Story} comes from, and is not - * supposed to change. + * supposed to change, even when re-imported. *

* It's the user representation of the enum * ({@link SupportType#getSourceName()}, not @@ -337,7 +337,7 @@ public class MetaData implements Cloneable, Comparable, Serializable { * output type this {@link Story} is in (see {@link SupportType}). *

* It allows you to know where the {@link Story} comes from, and is not - * supposed to change. + * supposed to change, even when re-imported. *

* It's the user representation of the enum * ({@link SupportType#getSourceName()}, not @@ -353,8 +353,8 @@ public class MetaData implements Cloneable, Comparable, Serializable { /** * The output type this {@link Story} is in (see {@link SupportType}). *

- * 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. *

* It's the direct representation of the enum * ({@link SupportType#toString()}, not @@ -369,8 +369,8 @@ public class MetaData implements Cloneable, Comparable, Serializable { /** * The output type this {@link Story} is in (see {@link SupportType}). *

- * 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. *

* It's the direct representation of the enum * ({@link SupportType#toString()}, not diff --git a/src/be/nikiroo/fanfix/supported/BasicSupport.java b/src/be/nikiroo/fanfix/supported/BasicSupport.java index bcfcca1..ff9ecaf 100644 --- a/src/be/nikiroo/fanfix/supported/BasicSupport.java +++ b/src/be/nikiroo/fanfix/supported/BasicSupport.java @@ -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 diff --git a/src/be/nikiroo/fanfix/supported/BasicSupport_Deprecated.java b/src/be/nikiroo/fanfix/supported/BasicSupport_Deprecated.java index 9aac6d5..512aabf 100644 --- a/src/be/nikiroo/fanfix/supported/BasicSupport_Deprecated.java +++ b/src/be/nikiroo/fanfix/supported/BasicSupport_Deprecated.java @@ -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()) { -- 2.27.0