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.ServerObject;
int diff = progress.getProgress() - current;
current += diff;
+ if (diff <= 0)
+ return;
+
StringBuilder builder = new StringBuilder();
for (int i = 0; i < diff; i++) {
builder.append('.');
}
}
+ // We cannot do it when in GUI mode, because it is async...
+ // So if we close the temp files before it is actually used,
+ // we have a problem...
+ // TODO: close it at the correct time (for now, finalize try to do it)
+ if (false) {
+ try {
+ Instance.getTempFiles().close();
+ } catch (IOException e) {
+ Instance.getTraceHandler().error(
+ new IOException(
+ "Cannot dispose of the temporary files", e));
+ }
+ }
+
if (exitCode == 255) {
syntax(false);
}
*
* @return the exit return code (0 = success)
*/
- private static int convert(String urlString, String typeString,
+ public static int convert(String urlString, String typeString,
String target, boolean infoCover, Progress pg) {
int exitCode = 0;
+ Instance.getTraceHandler().trace("Convert: " + urlString);
String sourceName = urlString;
try {
URL source = BasicReader.getUrl(urlString);
BasicSupport support = BasicSupport.getSupport(source);
if (support != null) {
+ Instance.getTraceHandler().trace("Support found: " + support.getClass());
Progress pgIn = new Progress();
Progress pgOut = new Progress();
if (pg != null) {
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, infoCover)