weblib: set custom covers
[fanfix.git] / src / be / nikiroo / fanfix / library / WebLibraryServerHtml.java
index 6489fdf75880e6d3488803d88fa4722091811ecc..e79d6f5ea4ad0a736dbaea826447d61682b50ad6 100644 (file)
@@ -50,6 +50,9 @@ abstract class WebLibraryServerHtml implements Runnable {
        abstract protected Response getCover(String uri, WLoginResult login)
                        throws IOException;
 
+       abstract protected Response setCover(String uri, String luid,
+                       WLoginResult login) throws IOException;
+
        abstract protected List<MetaData> metas(WLoginResult login)
                        throws IOException;
 
@@ -166,7 +169,12 @@ abstract class WebLibraryServerHtml implements Runnable {
                                                                                MIME_PLAINTEXT,
                                                                                Version.getCurrentVersion().toString());
                                                        } else if (WebLibraryUrls.isCoverUrl(uri)) {
-                                                               rep = getCover(uri, login);
+                                                               String luid = params.get("luid");
+                                                               if (luid != null) {
+                                                                       rep = setCover(uri, luid, login);
+                                                               } else {
+                                                                       rep = getCover(uri, login);
+                                                               }
                                                        } else if (WebLibraryUrls.isListUrl(uri)) {
                                                                rep = getList(uri, login);
                                                        } else if (WebLibraryUrls.isStoryUrl(uri)) {