package be.nikiroo.fanfix.supported;
-import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import be.nikiroo.fanfix.Instance;
import be.nikiroo.fanfix.data.MetaData;
-import be.nikiroo.utils.ImageUtils;
+import be.nikiroo.utils.Image;
import be.nikiroo.utils.Progress;
import be.nikiroo.utils.StringUtils;
-class MangaFox extends BasicSupport {
+class MangaFox extends BasicSupport_Deprecated {
@Override
protected boolean isHtml() {
return true;
try {
in.reset();
} catch (IOException e) {
- Instance.syserr(e);
+ Instance.getTraceHandler().error(e);
}
line = getLine(in, "/artist/", 0, false);
if (authors.isEmpty()) {
return null;
- } else {
- StringBuilder builder = new StringBuilder();
- for (String author : authors) {
- if (builder.length() > 0) {
- builder.append(", ");
- }
+ }
- builder.append(author);
+ StringBuilder builder = new StringBuilder();
+ for (String author : authors) {
+ if (builder.length() > 0) {
+ builder.append(", ");
}
- return builder.toString();
+ builder.append(author);
}
+
+ return builder.toString();
}
private String getDate(InputStream in) {
return null;
}
- private BufferedImage getCover(InputStream in) {
+ private Image getCover(InputStream in) {
String line = getLine(in, " property=\"og:image\"", 0);
String cover = null;
if (line != null) {
try {
coverIn = openEx(cover);
try {
- return ImageUtils.fromStream(coverIn);
+ return new Image(coverIn);
} finally {
coverIn.close();
}
final String key = name;
final URL value = new URL(url);
urls.add(new Entry<String, URL>() {
+ @Override
public URL setValue(URL value) {
return null;
}
+ @Override
public String getKey() {
return key;
}
+ @Override
public URL getValue() {
return value;
}
});
} catch (MalformedURLException e) {
- Instance.syserr(e);
+ Instance.getTraceHandler().error(e);
}
}
}
try {
in.reset();
} catch (IOException e) {
- Instance.syserr(e);
+ Instance.getTraceHandler().error(e);
}
String linkImageLine = getLine(in, "return enlarge()", 1);
try {
in.close();
} catch (IOException e) {
- Instance.syserr(e);
+ Instance.getTraceHandler().error(e);
}
}
setCurrentReferer(url);
pg.setProgress((i++) % pg.getMax());
} catch (IOException e) {
- Instance.syserr(new IOException(
- "Cannot get the next manga page which is: "
- + linkNext, e));
+ Instance.getTraceHandler().error(
+ new IOException(
+ "Cannot get the next manga page which is: "
+ + linkNext, e));
}
}
@Override
protected boolean supports(URL url) {
+ // Broken code (see MangaFoxNew)
+ if (true)
+ return false;
return "mangafox.me".equals(url.getHost())
|| "www.mangafox.me".equals(url.getHost());
}