From: Niki Roo Date: Sun, 3 Mar 2019 17:17:06 +0000 (+0100) Subject: remote: do not send the cover in the metas X-Git-Tag: fanfix-1.8.1~2 X-Git-Url: http://git.nikiroo.be/?p=fanfix.git;a=commitdiff_plain;h=9f51d8ab092b891f407dc1bfe0e0fa1cef7ff944 remote: do not send the cover in the metas --- diff --git a/src/be/nikiroo/fanfix/library/RemoteLibrary.java b/src/be/nikiroo/fanfix/library/RemoteLibrary.java index dc95f0d..71b65bf 100644 --- a/src/be/nikiroo/fanfix/library/RemoteLibrary.java +++ b/src/be/nikiroo/fanfix/library/RemoteLibrary.java @@ -446,6 +446,8 @@ public class RemoteLibrary extends BasicLibrary { /** * Return the meta of the given story or a list of all known metas if the * luid is "*". + *

+ * Will not get the covers. * * @param luid * the luid of the story or * diff --git a/src/be/nikiroo/fanfix/library/RemoteLibraryServer.java b/src/be/nikiroo/fanfix/library/RemoteLibraryServer.java index 7d5a0ae..c0b0506 100644 --- a/src/be/nikiroo/fanfix/library/RemoteLibraryServer.java +++ b/src/be/nikiroo/fanfix/library/RemoteLibraryServer.java @@ -103,12 +103,38 @@ public class RemoteLibraryServer extends ServerObject { return null; } + long start = new Date().getTime(); + Object rep = doRequest(action, command, args); + + getTraceHandler().trace( + String.format("[/%s]: %d ms", command, + (new Date().getTime() - start))); + + return rep; + } + + private Object doRequest(ConnectActionServerObject action, String command, + Object[] args) throws NoSuchFieldException, NoSuchMethodException, + ClassNotFoundException, IOException { if ("PING".equals(command)) { return "PONG"; } else if ("GET_METADATA".equals(command)) { if ("*".equals(args[0])) { Progress pg = createPgForwarder(action); - List metas = Instance.getLibrary().getMetas(pg); + + List metas = new ArrayList(); + for (MetaData meta : Instance.getLibrary().getMetas(pg)) { + MetaData light; + if (meta.getCover() == null) { + light = meta; + } else { + light = meta.clone(); + light.setCover(null); + } + + metas.add(light); + } + forcePgDoneSent(pg); return metas.toArray(new MetaData[] {}); }