import be.nikiroo.fanfix.reader.Reader;
import be.nikiroo.fanfix.reader.Reader.ReaderType;
import be.nikiroo.fanfix.supported.BasicSupport;
-import be.nikiroo.fanfix.supported.BasicSupport.SupportType;
+import be.nikiroo.fanfix.supported.SupportType;
import be.nikiroo.utils.Progress;
import be.nikiroo.utils.Version;
-import be.nikiroo.utils.serial.server.ConnectActionClientObject;
import be.nikiroo.utils.serial.server.ServerObject;
/**
} else if (port == null) {
port = Integer.parseInt(args[i]);
- File remoteCacheDir = Instance.getRemoteDir(host);
BasicLibrary lib = new RemoteLibrary(key, host, port);
- lib = new CacheLibrary(remoteCacheDir, lib);
+ lib = new CacheLibrary(Instance.getRemoteDir(host), lib);
BasicReader.setDefaultLibrary(lib);
case VERSION:
System.out
.println(String.format("Fanfix version %s"
- + "\nhttps://github.com/nikiroo/fanfix/"
- + "\n\tWritten by Nikiroo",
+ + "%nhttps://github.com/nikiroo/fanfix/"
+ + "%n\tWritten by Nikiroo",
Version.getCurrentVersion()));
updates.ok(); // we consider it read
break;
try {
ServerObject server = new RemoteLibraryServer(key, port);
server.setTraceHandler(Instance.getTraceHandler());
- server.start();
+ server.run();
} catch (IOException e) {
Instance.getTraceHandler().error(e);
}
break;
}
- try {
- final String fkey = key;
- new ConnectActionClientObject(host, port, true) {
- @Override
- public void action(Version serverVersion)
- throws Exception {
- try {
- send(new Object[] { fkey, "EXIT" });
- } catch (Exception e) {
- Instance.getTraceHandler().error(e);
- }
- }
- }.connect();
- } catch (IOException e) {
- Instance.getTraceHandler().error(e);
- }
+ new RemoteLibrary(key, host, port).exit();
break;
case REMOTE:
exitCode = 255; // should not be reachable (REMOTE -> START)
pg.addProgress(pgOut, 1);
}
- Story story = support.process(source, pgIn);
+ Story story = support.process(pgIn);
try {
target = new File(target).getAbsolutePath();
- BasicOutput.getOutput(type, infoCover).process(
- story, target, pgOut);
+ BasicOutput.getOutput(type, infoCover, infoCover)
+ .process(story, target, pgOut);
} catch (IOException e) {
Instance.getTraceHandler().error(
new IOException(trans(StringId.ERR_SAVING,