weblib: fix unauthorized detection on client
[nikiroo-utils.git] / src / be / nikiroo / fanfix / library / WebLibrary.java
index 1178e40c578b3bb2f2df46b3994de2b0770cc1ed..9769fea4420f14719b7053cbf9baeb04ce7a5119 100644 (file)
@@ -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