X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Flibrary%2FWebLibrary.java;h=6f2bfda3a9c111e7e70ffa1c4598ed57c716024a;hb=6673ec5924d57a37c4f995f9c81c50a187b51c63;hp=1178e40c578b3bb2f2df46b3994de2b0770cc1ed;hpb=5ee0fc14dbffa8d11b914537d957ef892ba20ef9;p=fanfix.git diff --git a/src/be/nikiroo/fanfix/library/WebLibrary.java b/src/be/nikiroo/fanfix/library/WebLibrary.java index 1178e40..6f2bfda 100644 --- a/src/be/nikiroo/fanfix/library/WebLibrary.java +++ b/src/be/nikiroo/fanfix/library/WebLibrary.java @@ -119,7 +119,7 @@ public class WebLibrary extends BasicLibrary { } catch (IOException e) { } - return null; + return new Version(); } @Override @@ -128,7 +128,7 @@ public class WebLibrary extends BasicLibrary { 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; @@ -140,7 +140,8 @@ public class WebLibrary extends BasicLibrary { @Override public String getLibraryName() { - return (rw ? "[READ-ONLY] " : "") + host + ":" + port; + return (rw ? "[READ-ONLY] " : "") + host + ":" + port + " (" + + getVersion() + ")"; } @Override @@ -154,15 +155,23 @@ public class WebLibrary extends BasicLibrary { } @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 - 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