X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Fsupported%2FFimfiction.java;h=e96ac4f5766eb601886e3b6574c27044fb33b81a;hb=727108fef9dcc661d45fa69ebf8b76f5128a2b6f;hp=24aca5d4169353268d5d4ca1df0e1ae0d712f243;hpb=62c63b0724f4bc45999cb2e7186b4b3ada479a0a;p=fanfix.git diff --git a/src/be/nikiroo/fanfix/supported/Fimfiction.java b/src/be/nikiroo/fanfix/supported/Fimfiction.java index 24aca5d..e96ac4f 100644 --- a/src/be/nikiroo/fanfix/supported/Fimfiction.java +++ b/src/be/nikiroo/fanfix/supported/Fimfiction.java @@ -1,10 +1,10 @@ package be.nikiroo.fanfix.supported; -import java.awt.image.BufferedImage; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; +import java.util.AbstractMap; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -14,6 +14,7 @@ import java.util.Scanner; import be.nikiroo.fanfix.Instance; import be.nikiroo.fanfix.data.MetaData; +import be.nikiroo.utils.Image; import be.nikiroo.utils.Progress; import be.nikiroo.utils.StringUtils; @@ -23,17 +24,12 @@ import be.nikiroo.utils.StringUtils; * * @author niki */ -class Fimfiction extends BasicSupport { +class Fimfiction extends BasicSupport_Deprecated { @Override protected boolean isHtml() { return true; } - @Override - public String getSourceName() { - return "FimFiction.net"; - } - @Override protected MetaData getMeta(URL source, InputStream in) throws IOException { MetaData meta = new MetaData(); @@ -42,12 +38,12 @@ class Fimfiction extends BasicSupport { meta.setAuthor(getAuthor(reset(in))); meta.setDate(getDate(reset(in))); meta.setTags(getTags(reset(in))); - meta.setSource(getSourceName()); + meta.setSource(getType().getSourceName()); meta.setUrl(source.toString()); - meta.setPublisher(getSourceName()); + meta.setPublisher(getType().getSourceName()); meta.setUuid(source.toString()); meta.setLuid(""); - meta.setLang("EN"); + meta.setLang("en"); meta.setSubject("MLP"); meta.setType(getType().toString()); meta.setImageDocument(false); @@ -173,7 +169,7 @@ class Fimfiction extends BasicSupport { return getLine(in, "class=\"description-text bbcode\"", 1); } - private BufferedImage getCover(InputStream in) { + private Image getCover(InputStream in) { // Note: the 'og:image' is the SMALL cover, not the full version String cover = getLine(in, "class=\"story_container__story_image\"", 1); if (cover != null) { @@ -231,25 +227,8 @@ class Fimfiction extends BasicSupport { } try { - final String key = name; - final URL value = new URL("http://www.fimfiction.net" - + line); - urls.add(new Entry() { - @Override - public URL setValue(URL value) { - return null; - } - - @Override - public String getKey() { - return key; - } - - @Override - public URL getValue() { - return value; - } - }); + urls.add(new AbstractMap.SimpleEntry(name, + new URL("http://www.fimfiction.net" + line))); } catch (MalformedURLException e) { Instance.getTraceHandler().error(e); }