X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Flibrary%2FRemoteLibrary.java;h=337e13fe7394c36f4d089f0e25700e487ed6c4d6;hb=99ccbdf63b539f1f40e070f5833f2d15fcf79830;hp=6c1e56f5d22f4ceee61ab260b722352efe583225;hpb=e42573a004fac26378c693ce9ef0d6319713c682;p=nikiroo-utils.git diff --git a/src/be/nikiroo/fanfix/library/RemoteLibrary.java b/src/be/nikiroo/fanfix/library/RemoteLibrary.java index 6c1e56f..337e13f 100644 --- a/src/be/nikiroo/fanfix/library/RemoteLibrary.java +++ b/src/be/nikiroo/fanfix/library/RemoteLibrary.java @@ -16,7 +16,7 @@ import be.nikiroo.utils.serial.ConnectActionClient; /** * This {@link BasicLibrary} will access a remote server to list the available - * stories, and download the one you try to load to the local directory + * stories, and download the ones you try to load to the local directory * specified in the configuration. * * @author niki @@ -48,6 +48,11 @@ public class RemoteLibrary extends BasicLibrary { OutputType.CBZ); } + @Override + public String getLibraryName() { + return host + ":" + port; + } + @Override protected List getMetas(Progress pg) { // TODO: progress @@ -57,6 +62,7 @@ public class RemoteLibrary extends BasicLibrary { try { new ConnectActionClient(host, port, true, null) { + @Override public void action(Version serverVersion) throws Exception { try { Object rep = send("GET_METADATA *"); @@ -83,6 +89,7 @@ public class RemoteLibrary extends BasicLibrary { final File[] tmp = new File[1]; try { new ConnectActionClient(host, port, true, null) { + @Override public void action(Version serverVersion) throws Exception { try { Object rep = send("GET_STORY " + luid); @@ -135,20 +142,32 @@ public class RemoteLibrary extends BasicLibrary { } @Override - protected int getNextId() { + public synchronized void delete(String luid) throws IOException { throw new java.lang.InternalError( "No write support allowed on remote Libraries"); } @Override - protected void doDelete(String luid) throws IOException { + public void setSourceCover(String source, String luid) { throw new java.lang.InternalError( "No write support allowed on remote Libraries"); } + // All the following methods are only used by Save and Delete in + // BasicLibrary: + + @Override + protected int getNextId() { + throw new java.lang.InternalError("Should not have been called"); + } + + @Override + protected void doDelete(String luid) throws IOException { + throw new java.lang.InternalError("Should not have been called"); + } + @Override protected Story doSave(Story story, Progress pg) throws IOException { - throw new java.lang.InternalError( - "No write support allowed on remote Libraries"); + throw new java.lang.InternalError("Should not have been called"); } }