offline: download process fixes

This commit is contained in:
Andrew Dolgov 2009-02-11 15:48:03 +03:00
parent 048701937d
commit e8080ee95c
1 changed files with 8 additions and 4 deletions

View File

@ -760,11 +760,9 @@ function update_offline_data(stage) {
if (!stage) stage = 0; if (!stage) stage = 0;
if (!db || offline_mode || getInitParam("offline_enabled") != "1") return; if (!db || offline_mode || getInitParam("offline_enabled") != "1") return;
debug("update_offline_data: stage " + stage);
// notify_progress("Updating offline data... (" + stage +")", true); // 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"); var rs = db.execute("SELECT MAX(id), MIN(id) FROM articles");
@ -774,10 +772,16 @@ function update_offline_data(stage) {
query = query + "&cidt=" + offline_dl_max_id; query = query + "&cidt=" + offline_dl_max_id;
query = query + "&cidb=" + offline_dl_min_id; query = query + "&cidb=" + offline_dl_min_id;
stage = 1;
} }
rs.close(); rs.close();
debug("update_offline_data: stage " + stage);
query = query + "&stage=" + stage;
var to_sync = prepare_local_sync_data(); var to_sync = prepare_local_sync_data();
if (to_sync != "") { if (to_sync != "") {