git://git.nikiroo.be
/
fanfix.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gui: allow 'all' and 'listing' for sources and authors
[fanfix.git]
/
src
/
be
/
nikiroo
/
fanfix
/
Main.java
diff --git
a/src/be/nikiroo/fanfix/Main.java
b/src/be/nikiroo/fanfix/Main.java
index 354541219f0db8c433f79192b608f6373538244d..f83186c1d89bffdd01b1c837a1b29b6047cb5f33 100644
(file)
--- a/
src/be/nikiroo/fanfix/Main.java
+++ b/
src/be/nikiroo/fanfix/Main.java
@@
-21,7
+21,7
@@
import be.nikiroo.fanfix.reader.BasicReader;
import be.nikiroo.fanfix.reader.Reader;
import be.nikiroo.fanfix.reader.Reader.ReaderType;
import be.nikiroo.fanfix.supported.BasicSupport;
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;
import be.nikiroo.utils.Progress;
import be.nikiroo.utils.Version;
import be.nikiroo.utils.serial.server.ServerObject;
@@
-221,6
+221,9
@@
public class Main {
int diff = progress.getProgress() - current;
current += diff;
int diff = progress.getProgress() - current;
current += diff;
+ if (diff <= 0)
+ return;
+
StringBuilder builder = new StringBuilder();
for (int i = 0; i < diff; i++) {
builder.append('.');
StringBuilder builder = new StringBuilder();
for (int i = 0; i < diff; i++) {
builder.append('.');
@@
-351,6
+354,14
@@
public class Main {
}
}
}
}
+ try {
+ Instance.getTempFiles().close();
+ } catch (IOException e) {
+ Instance.getTraceHandler()
+ .error(new IOException(
+ "Cannot dispose of the temporary files", e));
+ }
+
if (exitCode == 255) {
syntax(false);
}
if (exitCode == 255) {
syntax(false);
}
@@
-445,7
+456,7
@@
public class Main {
}
/**
}
/**
- * Start the
CLI
reader for this {@link Story}.
+ * Start the
current
reader for this {@link Story}.
*
* @param story
* the LUID of the {@link Story} in the {@link LocalLibrary}
*
* @param story
* the LUID of the {@link Story} in the {@link LocalLibrary}
@@
-471,7
+482,7
@@
public class Main {
if (chapString != null) {
try {
reader.setChapter(Integer.parseInt(chapString));
if (chapString != null) {
try {
reader.setChapter(Integer.parseInt(chapString));
- reader.read();
+ reader.read(
true
);
} catch (NumberFormatException e) {
Instance.getTraceHandler().error(
new IOException("Chapter number cannot be parsed: "
} catch (NumberFormatException e) {
Instance.getTraceHandler().error(
new IOException("Chapter number cannot be parsed: "
@@
-479,7
+490,7
@@
public class Main {
return 2;
}
} else {
return 2;
}
} else {
- reader.read();
+ reader.read(
true
);
}
} catch (IOException e) {
Instance.getTraceHandler().error(e);
}
} catch (IOException e) {
Instance.getTraceHandler().error(e);
@@
-506,10
+517,11
@@
public class Main {
*
* @return the exit return code (0 = success)
*/
*
* @return the exit return code (0 = success)
*/
- p
rivate
static int convert(String urlString, String typeString,
+ p
ublic
static int convert(String urlString, String typeString,
String target, boolean infoCover, Progress pg) {
int exitCode = 0;
String target, boolean infoCover, Progress pg) {
int exitCode = 0;
+ Instance.getTraceHandler().trace("Convert: " + urlString);
String sourceName = urlString;
try {
URL source = BasicReader.getUrl(urlString);
String sourceName = urlString;
try {
URL source = BasicReader.getUrl(urlString);
@@
-530,6
+542,8
@@
public class Main {
BasicSupport support = BasicSupport.getSupport(source);
if (support != null) {
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) {
Progress pgIn = new Progress();
Progress pgOut = new Progress();
if (pg != null) {
@@
-538,7
+552,7
@@
public class Main {
pg.addProgress(pgOut, 1);
}
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)
try {
target = new File(target).getAbsolutePath();
BasicOutput.getOutput(type, infoCover, infoCover)