Change BasicSupport to use jsoup
[nikiroo-utils.git] / src / be / nikiroo / fanfix / supported / InfoReader.java
index ccffd7c9d27205713cfe6e623b3a8c4c56532aac..5203cc86107017c6fa3b3a236fe56f869def7c8c 100644 (file)
@@ -56,8 +56,11 @@ public class InfoReader {
                meta.setType(getInfoTag(in, "TYPE"));
                meta.setImageDocument(getInfoTagBoolean(in, "IMAGES_DOCUMENT", false));
                if (withCover) {
-                       meta.setCover(BasicSupport.getImage(null, sourceInfoFile,
-                                       getInfoTag(in, "COVER")));
+                       String infoTag = getInfoTag(in, "COVER");
+                       if (infoTag != null && !infoTag.trim().isEmpty()) {
+                               meta.setCover(BasicSupportHelper.getImage(null, sourceInfoFile,
+                                               infoTag));
+                       }
                        // Second chance: try to check for a cover next to the info file
                        if (meta.getCover() == null) {
                                String info = sourceInfoFile.getFile().toString();
@@ -67,8 +70,8 @@ public class InfoReader {
                                                        + Instance.getConfig()
                                                                        .getString(Config.IMAGE_FORMAT_COVER)
                                                                        .toLowerCase();
-                                       meta.setCover(BasicSupport.getImage(null, sourceInfoFile,
-                                                       info + ext));
+                                       meta.setCover(BasicSupportHelper.getImage(null,
+                                                       sourceInfoFile, info + ext));
                                }
                        }
                }
@@ -81,7 +84,7 @@ public class InfoReader {
                meta.setFakeCover(Boolean.parseBoolean(getInfoTag(in, "FAKE_COVER")));
 
                if (withCover && meta.getCover() == null) {
-                       meta.setCover(BasicSupport.getDefaultCover(meta.getSubject()));
+                       meta.setCover(BasicSupportHelper.getDefaultCover(meta.getSubject()));
                }
 
                return meta;
@@ -135,7 +138,7 @@ public class InfoReader {
 
                if (in != null) {
                        in.reset();
-                       String value = BasicSupport.getLine(in, key, 0);
+                       String value = BasicSupport_Deprecated.getLine(in, key, 0);
                        if (value != null && !value.isEmpty()) {
                                value = value.trim().substring(key.length() - 1).trim();
                                if (value.startsWith("'") && value.endsWith("'")