- return Instance.getLibrary().getCover("" + args[0]);
- } else if ("GET_SOURCE_COVER".equals(command)) {
- return Instance.getLibrary().getSourceCover("" + args[0]);
- } else if ("SET_SOURCE_COVER".equals(command)) {
- Instance.getLibrary().setSourceCover("" + args[0], "" + args[1]);
+ return Instance.getInstance().getLibrary().getCover((String) args[0]);
+ } else if ("GET_CUSTOM_COVER".equals(command)) {
+ if ("SOURCE".equals(args[0])) {
+ return Instance.getInstance().getLibrary().getCustomSourceCover((String) args[1]);
+ } else if ("AUTHOR".equals(args[0])) {
+ return Instance.getInstance().getLibrary().getCustomAuthorCover((String) args[1]);
+ } else {
+ return null;
+ }
+ } else if ("SET_COVER".equals(command)) {
+ if (!rw) {
+ throw new RemoteLibraryException("Read-Only remote library: "
+ + args[0] + ", " + args[1], false);
+ }
+
+ if ("SOURCE".equals(args[0])) {
+ Instance.getInstance().getLibrary().setSourceCover((String) args[1], (String) args[2]);
+ } else if ("AUTHOR".equals(args[0])) {
+ Instance.getInstance().getLibrary().setAuthorCover((String) args[1], (String) args[2]);
+ }
+ } else if ("CHANGE_STA".equals(command)) {
+ if (!rw) {
+ throw new RemoteLibraryException("Read-Only remote library: " + args[0] + ", " + args[1], false);
+ }
+
+ Progress pg = createPgForwarder(action);
+ Instance.getInstance().getLibrary().changeSTA((String) args[0], (String) args[1], (String) args[2],
+ (String) args[3], pg);
+ forcePgDoneSent(pg);