commit 5f6952c5bc928db3358363e8c0c46531173551b5
parent 1d799a0bbea0beab3d52235bd3ba33e999fbe481
Author: Dan Stillman <dstillman@zotero.org>
Date: Mon, 14 Sep 2009 18:31:49 +0000
Don't update attachment item date modified when syncing
Diffstat:
3 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/chrome/content/zotero/xpcom/storage.js b/chrome/content/zotero/xpcom/storage.js
@@ -211,11 +211,8 @@ Zotero.Sync.Storage = new function () {
if (updateItem) {
// Update item date modified so the new mod time will be synced
- var item = Zotero.Items.get(itemID);
- //var date = new Date(mtime * 1000);
- //item.setField('dateModified', Zotero.Date.dateToSQL(date, true));
- item.setField('dateModified', Zotero.DB.transactionDateTime);
- item.save();
+ var sql = "UPDATE items SET clientDateModified=? WHERE itemID=?";
+ Zotero.DB.query(sql, [Zotero.DB.transactionDateTime, itemID]);
}
Zotero.DB.commitTransaction();
@@ -254,10 +251,9 @@ Zotero.Sync.Storage = new function () {
Zotero.DB.valueQuery(sql, [hash, itemID]);
if (updateItem) {
- // Update item date modified so the new hash will be synced
- var item = Zotero.Items.get(itemID);
- item.setField('dateModified', Zotero.DB.transactionDateTime);
- item.save();
+ // Update item date modified so the new mod time will be synced
+ var sql = "UPDATE items SET clientDateModified=? WHERE itemID=?";
+ Zotero.DB.query(sql, [Zotero.DB.transactionDateTime, itemID]);
}
Zotero.DB.commitTransaction();
diff --git a/chrome/content/zotero/xpcom/storage/webdav.js b/chrome/content/zotero/xpcom/storage/webdav.js
@@ -515,7 +515,7 @@ Zotero.Sync.Storage.Session.WebDAV.prototype._onUploadComplete = function (httpR
Zotero.Sync.Storage.setSyncedModificationTime(item.id, mtime, true);
var hash = item.attachmentHash;
- Zotero.Sync.Storage.setSyncedHash(item.id, hash, true);
+ Zotero.Sync.Storage.setSyncedHash(item.id, hash);
Zotero.DB.commitTransaction();
diff --git a/chrome/content/zotero/xpcom/storage/zfs.js b/chrome/content/zotero/xpcom/storage/zfs.js
@@ -633,12 +633,12 @@ Zotero.Sync.Storage.Session.ZFS.prototype._updateItemFileInfo = function (item)
// Store file mod time
var mtime = item.attachmentModificationTime;
- Zotero.Sync.Storage.setSyncedModificationTime(item.id, mtime, false);
+ Zotero.Sync.Storage.setSyncedModificationTime(item.id, mtime, true);
// Store file hash of individual files
if (Zotero.Attachments.getNumFiles(item) == 1) {
var hash = item.attachmentHash;
- Zotero.Sync.Storage.setSyncedHash(item.id, hash, true);
+ Zotero.Sync.Storage.setSyncedHash(item.id, hash);
}
Zotero.DB.commitTransaction();