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
add get custom covers
[nikiroo-utils.git]
/
src
/
be
/
nikiroo
/
fanfix
/
library
/
WebLibrary.java
diff --git
a/src/be/nikiroo/fanfix/library/WebLibrary.java
b/src/be/nikiroo/fanfix/library/WebLibrary.java
index 8c71ff590b41b85bba46e715b0ea8328af383592..6f2bfda3a9c111e7e70ffa1c4598ed57c716024a 100644
(file)
--- a/
src/be/nikiroo/fanfix/library/WebLibrary.java
+++ b/
src/be/nikiroo/fanfix/library/WebLibrary.java
@@
-128,7
+128,7
@@
public class WebLibrary extends BasicLibrary {
download(WebLibraryUrls.INDEX_URL).close();
} catch (IOException e) {
try {
download(WebLibraryUrls.INDEX_URL).close();
} catch (IOException e) {
try {
- download(
WebLibraryUrls.VERSION_URL
).close();
+ download(
"/style.css"
).close();
return Status.UNAUTHORIZED;
} catch (IOException ioe) {
return Status.UNAVAILABLE;
return Status.UNAUTHORIZED;
} catch (IOException ioe) {
return Status.UNAVAILABLE;
@@
-155,15
+155,23
@@
public class WebLibrary extends BasicLibrary {
}
@Override
}
@Override
- public Image getCustomSourceCover(final String source) throws IOException {
- // TODO maybe global system in BasicLib ?
- return null;
+ public Image getCustomSourceCover(String source) throws IOException {
+ InputStream in = download(WebLibraryUrls.getCoverUrlSource(source));
+ try {
+ return new Image(in);
+ } finally {
+ in.close();
+ }
}
@Override
}
@Override
- public Image getCustomAuthorCover(final String author) throws IOException {
- // TODO maybe global system in BasicLib ?
- return null;
+ public Image getCustomAuthorCover(String author) throws IOException {
+ InputStream in = download(WebLibraryUrls.getCoverUrlAuthor(author));
+ try {
+ return new Image(in);
+ } finally {
+ in.close();
+ }
}
@Override
}
@Override