From: Niki Roo Date: Mon, 22 Apr 2019 09:22:49 +0000 (+0200) Subject: sercer: fix one arg cmd, traces X-Git-Tag: fanfix-swing-0.0.1~12^2~110 X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=27eba894912a5b9a748d85c647f2f3a5b3a8a1c4;p=fanfix-swing.git sercer: fix one arg cmd, traces --- diff --git a/src/be/nikiroo/fanfix/library/RemoteLibrary.java b/src/be/nikiroo/fanfix/library/RemoteLibrary.java index 884eee9a..3318c12b 100644 --- a/src/be/nikiroo/fanfix/library/RemoteLibrary.java +++ b/src/be/nikiroo/fanfix/library/RemoteLibrary.java @@ -134,8 +134,8 @@ public class RemoteLibrary extends BasicLibrary { new ConnectActionClientObject(host, port, false) { @Override public void action(Version serverVersion) throws Exception { - Object rep = sendCmd(this, - new Object[] { "GET_CUSTOM_COVER", type, source }); + Object rep = sendCmd(this, new Object[] { + "GET_CUSTOM_COVER", type, source }); result[0] = (Image) rep; } @@ -177,8 +177,7 @@ public class RemoteLibrary extends BasicLibrary { } List list = new ArrayList(); - for (Object obj = send(null); obj != null; obj = send( - null)) { + for (Object obj = send(null); obj != null; obj = send(null)) { list.add(obj); pg.add(1); } @@ -500,9 +499,8 @@ public class RemoteLibrary extends BasicLibrary { pg = new Progress(); } - - Object rep = sendCmd(this, - new Object[] { "GET_METADATA", luid }); + Object rep = sendCmd(this, new Object[] { "GET_METADATA", + luid }); while (true) { if (!RemoteLibraryServer.updateProgress(pg, rep)) { @@ -540,11 +538,6 @@ public class RemoteLibrary extends BasicLibrary { Object rep = action.send(params); String hash = hashKey(key, "" + rep); - rep = action.send(hash); - if (rep == null) { - throw new java.lang.IllegalArgumentException(); - } - return action.send(hash); } diff --git a/src/be/nikiroo/fanfix/library/RemoteLibraryServer.java b/src/be/nikiroo/fanfix/library/RemoteLibraryServer.java index f0d5f7ae..a40103c0 100644 --- a/src/be/nikiroo/fanfix/library/RemoteLibraryServer.java +++ b/src/be/nikiroo/fanfix/library/RemoteLibraryServer.java @@ -87,7 +87,7 @@ public class RemoteLibraryServer extends ServerObject { Object[] args = new Object[0]; if (data instanceof Object[]) { Object[] dataArray = (Object[]) data; - if (dataArray.length >= 2) { + if (dataArray.length > 0) { command = "" + dataArray[0]; args = new Object[dataArray.length - 1];