Fix remote timeot (try1) + reverse e621 /post/
[fanfix.git] / src / be / nikiroo / fanfix / library / BasicLibrary.java
index 56a57070b0e2ab66fb0d78d97a43c847ed2cc06d..129c8fb33b1fc764c18a28661c3d45216b724f21 100644 (file)
@@ -398,12 +398,24 @@ abstract public class BasicLibrary {
         *             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);
                }
 
-               return save(support.process(pg), null);
+               Story story = save(support.process(pgProcess), pgSave);
+               pg.done();
+
+               return story;
        }
 
        /**