]> git.wh0rd.org Git - tt-rss.git/commitdiff
offline: download process fixes
authorAndrew Dolgov <fox@bah.org.ru>
Wed, 11 Feb 2009 12:48:03 +0000 (15:48 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Wed, 11 Feb 2009 12:48:03 +0000 (15:48 +0300)
offline.js

index 4b2114560700f32d98d3ad8d49fe88154728e67c..7ffbc39fa8565b5ed493441b119943ccdd8edb0a 100644 (file)
@@ -760,12 +760,10 @@ function update_offline_data(stage) {
                if (!stage) stage = 0;
                if (!db || offline_mode || getInitParam("offline_enabled") != "1") return;
 
-               debug("update_offline_data: stage " + stage);
-
 //             notify_progress("Updating offline data... (" + stage +")", true);
 
-               var query = "backend.php?op=rpc&subop=download&stage=" + stage;
-
+               var query = "backend.php?op=rpc&subop=download";
+               
                var rs = db.execute("SELECT MAX(id), MIN(id) FROM articles");
 
                if (rs.isValidRow() && rs.field(0)) {
@@ -774,10 +772,16 @@ function update_offline_data(stage) {
 
                        query = query + "&cidt=" + offline_dl_max_id;
                        query = query + "&cidb=" + offline_dl_min_id;
+
+                       stage = 1;
                }
 
                rs.close();
 
+               debug("update_offline_data: stage " + stage);
+
+               query = query + "&stage=" + stage;
+
                var to_sync = prepare_local_sync_data();
 
                if (to_sync != "") {