Change BasicSupport to use jsoup
[nikiroo-utils.git] / src / be / nikiroo / fanfix / library / BasicLibrary.java
index 9e7d4644494e5b51d871091868c3c1e47d882f53..350a8cafcc6ecc4ff2eafba768e052fe323db122 100644 (file)
@@ -1,6 +1,5 @@
 package be.nikiroo.fanfix.library;
 
-import java.awt.image.BufferedImage;
 import java.io.File;
 import java.io.IOException;
 import java.net.URL;
@@ -15,7 +14,8 @@ import be.nikiroo.fanfix.data.Story;
 import be.nikiroo.fanfix.output.BasicOutput;
 import be.nikiroo.fanfix.output.BasicOutput.OutputType;
 import be.nikiroo.fanfix.supported.BasicSupport;
-import be.nikiroo.fanfix.supported.BasicSupport.SupportType;
+import be.nikiroo.fanfix.supported.SupportType;
+import be.nikiroo.utils.Image;
 import be.nikiroo.utils.Progress;
 
 /**
@@ -89,7 +89,7 @@ abstract public class BasicLibrary {
         * 
         * @return the cover image
         */
-       public abstract BufferedImage getCover(String luid);
+       public abstract Image getCover(String luid);
 
        /**
         * Return the cover image associated to this source.
@@ -101,7 +101,7 @@ abstract public class BasicLibrary {
         * 
         * @return the cover image or NULL
         */
-       public BufferedImage getSourceCover(String source) {
+       public Image getSourceCover(String source) {
                List<MetaData> metas = getListBySource(source);
                if (metas.size() > 0) {
                        return getCover(metas.get(0).getLuid());
@@ -343,8 +343,8 @@ abstract public class BasicLibrary {
                                                        .getType());
                                        URL url = file.toURI().toURL();
                                        if (type != null) {
-                                               story = BasicSupport.getSupport(type).process(url,
-                                                               pgProcess);
+                                               story = BasicSupport.getSupport(type, url) //
+                                                               .process(pgProcess);
                                                // Because we do not want to clear the meta cache:
                                                meta.setCover(story.getMeta().getCover());
                                                story.setMeta(meta);
@@ -392,7 +392,7 @@ abstract public class BasicLibrary {
                        throw new UnknownHostException("" + url);
                }
 
-               return save(support.process(url, pg), null);
+               return save(support.process(pg), null);
        }
 
        /**