Try 2
[nikiroo-utils.git] / src / be / nikiroo / fanfix / library / RemoteLibraryServer.java
index adef7edea06e5ca7f9d0bbc0ff1323252f8f7ff5..138246ae47044a33399b132ac6c619ca320083df 100644 (file)
@@ -2,7 +2,6 @@ package be.nikiroo.fanfix.library;
 
 import java.io.IOException;
 import java.net.URL;
-import java.security.InvalidParameterException;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -29,7 +28,10 @@ import be.nikiroo.utils.serial.server.ServerObject;
  * <ul>
  * <li>[md5] PING: will return PONG if the key is accepted</li>
  * <li>[md5] GET_METADATA *: will return the metadata of all the stories in the
- * library</li>
+ * library (array)</li>
+ * *
+ * <li>[md5] GET_METADATA [luid]: will return the metadata of the story of LUID
+ * luid</li>
  * <li>[md5] GET_STORY [luid]: will return the given story if it exists (or NULL
  * if not)</li>
  * <li>[md5] SAVE_STORY [luid]: save the story (that must be sent just after the
@@ -108,8 +110,9 @@ public class RemoteLibraryServer extends ServerObject {
                                                createPgForwarder(action));
                                return metas.toArray(new MetaData[] {});
                        }
-                       throw new InvalidParameterException(
-                                       "only * is valid here, but you passed: " + args[0]);
+
+                       return new MetaData[] { Instance.getLibrary().getInfo(
+                                       (String) args[0]) };
                } else if ("GET_STORY".equals(command)) {
                        MetaData meta = Instance.getLibrary().getInfo((String) args[0]);
                        meta = meta.clone();
@@ -175,6 +178,8 @@ public class RemoteLibraryServer extends ServerObject {
         * @return the list of {@link Object}s
         */
        static List<Object> breakStory(Story story) {
+               System.out.println("Story to break: "+story);
+               
                List<Object> list = new ArrayList<Object>();
 
                story = story.clone();
@@ -215,6 +220,7 @@ public class RemoteLibraryServer extends ServerObject {
                        }
                }
 
+               System.out.println("rebuilt story: "+story);
                return story;
        }