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
e621: fix detection of "?tags" urls
[fanfix.git]
/
src
/
be
/
nikiroo
/
fanfix
/
library
/
BasicLibrary.java
diff --git
a/src/be/nikiroo/fanfix/library/BasicLibrary.java
b/src/be/nikiroo/fanfix/library/BasicLibrary.java
index a9b6ef3b1e19e0c259a49d136311605e19c1fa85..129c8fb33b1fc764c18a28661c3d45216b724f21 100644
(file)
--- a/
src/be/nikiroo/fanfix/library/BasicLibrary.java
+++ b/
src/be/nikiroo/fanfix/library/BasicLibrary.java
@@
-353,9
+353,9
@@
abstract public class BasicLibrary {
.getType());
URL url = file.toURI().toURL();
if (type != null) {
.getType());
URL url = file.toURI().toURL();
if (type != null) {
-System.out.println("selected support: "+BasicSupport.getSupport(type, url));
story = BasicSupport.getSupport(type, url) //
.process(pgProcess);
story = BasicSupport.getSupport(type, url) //
.process(pgProcess);
+
// Because we do not want to clear the meta cache:
meta.setCover(story.getMeta().getCover());
story.setMeta(meta);
// Because we do not want to clear the meta cache:
meta.setCover(story.getMeta().getCover());
story.setMeta(meta);
@@
-398,12
+398,24
@@
System.out.println("selected support: "+BasicSupport.getSupport(type, url));
* in case of I/O error
*/
public Story imprt(URL url, Progress pg) throws IOException {
* in case of I/O error
*/
public Story imprt(URL url, Progress pg) throws IOException {
+ if (pg == null)
+ pg = new Progress();
+
+ pg.setMinMax(0, 1000);
+ Progress pgProcess = new Progress();
+ Progress pgSave = new Progress();
+ pg.addProgress(pgProcess, 800);
+ pg.addProgress(pgSave, 200);
+
BasicSupport support = BasicSupport.getSupport(url);
if (support == null) {
throw new UnknownHostException("" + url);
}
BasicSupport support = BasicSupport.getSupport(url);
if (support == null) {
throw new UnknownHostException("" + url);
}
- return save(support.process(pg), null);
+ Story story = save(support.process(pgProcess), pgSave);
+ pg.done();
+
+ return story;
}
/**
}
/**
@@
-519,6
+531,9
@@
System.out.println("selected support: "+BasicSupport.getSupport(type, url));
public synchronized Story save(Story story, String luid, Progress pg)
throws IOException {
public synchronized Story save(Story story, String luid, Progress pg)
throws IOException {
+ Instance.getTraceHandler().trace(
+ this.getClass().getSimpleName() + ": saving story " + luid);
+
// Do not change the original metadata, but change the original story
MetaData meta = story.getMeta().clone();
story.setMeta(meta);
// Do not change the original metadata, but change the original story
MetaData meta = story.getMeta().clone();
story.setMeta(meta);
@@
-537,6
+552,10
@@
System.out.println("selected support: "+BasicSupport.getSupport(type, url));
updateInfo(story.getMeta());
updateInfo(story.getMeta());
+ Instance.getTraceHandler().trace(
+ this.getClass().getSimpleName() + ": story saved (" + luid
+ + ")");
+
return story;
}
return story;
}
@@
-550,8
+569,15
@@
System.out.println("selected support: "+BasicSupport.getSupport(type, url));
* in case of I/O error
*/
public synchronized void delete(String luid) throws IOException {
* in case of I/O error
*/
public synchronized void delete(String luid) throws IOException {
+ Instance.getTraceHandler().trace(
+ this.getClass().getSimpleName() + ": deleting story " + luid);
+
doDelete(luid);
deleteInfo(luid);
doDelete(luid);
deleteInfo(luid);
+
+ Instance.getTraceHandler().trace(
+ this.getClass().getSimpleName() + ": story deleted (" + luid
+ + ")");
}
/**
}
/**