git://git.nikiroo.be
/
nikiroo-utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Small fixes, including better external launcher
[nikiroo-utils.git]
/
src
/
be
/
nikiroo
/
fanfix
/
supported
/
MangaFox.java
diff --git
a/src/be/nikiroo/fanfix/supported/MangaFox.java
b/src/be/nikiroo/fanfix/supported/MangaFox.java
index c8eaa1d3035d0fabee3af3ccd2a797ec080a7cce..8d31cb83adacf1a7fa7f80dda01a3ac380197086 100644
(file)
--- a/
src/be/nikiroo/fanfix/supported/MangaFox.java
+++ b/
src/be/nikiroo/fanfix/supported/MangaFox.java
@@
-1,6
+1,5
@@
package be.nikiroo.fanfix.supported;
package be.nikiroo.fanfix.supported;
-import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
@@
-13,7
+12,7
@@
import java.util.Scanner;
import be.nikiroo.fanfix.Instance;
import be.nikiroo.fanfix.data.MetaData;
import be.nikiroo.fanfix.Instance;
import be.nikiroo.fanfix.data.MetaData;
-import be.nikiroo.utils.Image
Utils
;
+import be.nikiroo.utils.Image;
import be.nikiroo.utils.Progress;
import be.nikiroo.utils.StringUtils;
import be.nikiroo.utils.Progress;
import be.nikiroo.utils.StringUtils;
@@
-103,7
+102,7
@@
class MangaFox extends BasicSupport {
try {
in.reset();
} catch (IOException e) {
try {
in.reset();
} catch (IOException e) {
- Instance.
syser
r(e);
+ Instance.
getTraceHandler().erro
r(e);
}
line = getLine(in, "/artist/", 0, false);
}
line = getLine(in, "/artist/", 0, false);
@@
-118,18
+117,18
@@
class MangaFox extends BasicSupport {
if (authors.isEmpty()) {
return null;
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) {
}
private String getDate(InputStream in) {
@@
-163,7
+162,7
@@
class MangaFox extends BasicSupport {
return null;
}
return null;
}
- private
Buffered
Image getCover(InputStream in) {
+ private Image getCover(InputStream in) {
String line = getLine(in, " property=\"og:image\"", 0);
String cover = null;
if (line != null) {
String line = getLine(in, " property=\"og:image\"", 0);
String cover = null;
if (line != null) {
@@
-186,7
+185,7
@@
class MangaFox extends BasicSupport {
try {
coverIn = openEx(cover);
try {
try {
coverIn = openEx(cover);
try {
- return
ImageUtils.fromStream
(coverIn);
+ return
new Image
(coverIn);
} finally {
coverIn.close();
}
} finally {
coverIn.close();
}
@@
-246,20
+245,23
@@
class MangaFox extends BasicSupport {
final String key = name;
final URL value = new URL(url);
urls.add(new Entry<String, URL>() {
final String key = name;
final URL value = new URL(url);
urls.add(new Entry<String, URL>() {
+ @Override
public URL setValue(URL value) {
return null;
}
public URL setValue(URL value) {
return null;
}
+ @Override
public String getKey() {
return key;
}
public String getKey() {
return key;
}
+ @Override
public URL getValue() {
return value;
}
});
} catch (MalformedURLException e) {
public URL getValue() {
return value;
}
});
} catch (MalformedURLException e) {
- Instance.
syser
r(e);
+ Instance.
getTraceHandler().erro
r(e);
}
}
}
}
}
}
@@
-306,7
+308,7
@@
class MangaFox extends BasicSupport {
try {
in.reset();
} catch (IOException e) {
try {
in.reset();
} catch (IOException e) {
- Instance.
syser
r(e);
+ Instance.
getTraceHandler().erro
r(e);
}
String linkImageLine = getLine(in, "return enlarge()", 1);
}
String linkImageLine = getLine(in, "return enlarge()", 1);
@@
-345,7
+347,7
@@
class MangaFox extends BasicSupport {
try {
in.close();
} catch (IOException e) {
try {
in.close();
} catch (IOException e) {
- Instance.
syser
r(e);
+ Instance.
getTraceHandler().erro
r(e);
}
}
}
}
@@
-358,9
+360,10
@@
class MangaFox extends BasicSupport {
setCurrentReferer(url);
pg.setProgress((i++) % pg.getMax());
} catch (IOException 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));
}
}
}
}