X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Fsupported%2FFimfiction.java;h=b5df2618ce671ddaf04d7f5b644c3110c721339b;hb=cfdaf6052ddc5ca44cf19f1f6d9f154cc8443024;hp=cb26ac6fc42939682ff716d987e305f4aa720ef6;hpb=211f7ddb50f68aa8a999023ef6d63d5756bdace6;p=fanfix.git diff --git a/src/be/nikiroo/fanfix/supported/Fimfiction.java b/src/be/nikiroo/fanfix/supported/Fimfiction.java index cb26ac6..b5df261 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,14 +38,11 @@ class Fimfiction extends BasicSupport { meta.setAuthor(getAuthor(reset(in))); meta.setDate(getDate(reset(in))); meta.setTags(getTags(reset(in))); - meta.setSource(getSourceName()); meta.setUrl(source.toString()); - meta.setPublisher(getSourceName()); meta.setUuid(source.toString()); meta.setLuid(""); - meta.setLang("EN"); + meta.setLang("en"); meta.setSubject("MLP"); - meta.setType(getType().toString()); meta.setImageDocument(false); meta.setCover(getCover(reset(in))); @@ -173,7 +166,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,27 +224,10 @@ 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.syserr(e); + Instance.getInstance().getTraceHandler().error(e); } } }