From c270766540f012030457c58bf3b91963a06629f4 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 11 Mar 2013 21:41:51 -0400 Subject: [PATCH] Skip repeated file syncs for libraries with no uploaded files --- chrome/content/zotero/xpcom/storage.js | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/chrome/content/zotero/xpcom/storage.js b/chrome/content/zotero/xpcom/storage.js index d2a5dfefe3..60a1855614 100644 --- a/chrome/content/zotero/xpcom/storage.js +++ b/chrome/content/zotero/xpcom/storage.js @@ -238,14 +238,23 @@ Zotero.Sync.Storage = new function () { // If we don't have any forced downloads, we can skip // downloads if the last sync time hasn't changed - if (downloadAll && !downloadForced && lastSyncTime) { - var version = self.getStoredLastSyncTime( - libraryModes[libraryID], libraryID - ); - if (version == lastSyncTime) { - Zotero.debug("Last " + libraryModes[libraryID].name - + " sync time hasn't changed for library " - + libraryID + " -- skipping file downloads"); + // or doesn't exist on the server (meaning there are no files) + if (downloadAll && !downloadForced) { + if (lastSyncTime) { + var version = self.getStoredLastSyncTime( + libraryModes[libraryID], libraryID + ); + if (version == lastSyncTime) { + Zotero.debug("Last " + libraryModes[libraryID].name + + " sync time hasn't changed for library " + + libraryID + " -- skipping file downloads"); + downloadAll = false; + } + } + else { + Zotero.debug("No last " + libraryModes[libraryID].name + + " sync time for library " + libraryID + + " -- skipping file downloads"); downloadAll = false; } }