Don't update attachment item date modified when syncing
This commit is contained in:
parent
1d799a0bbe
commit
5f6952c5bc
3 changed files with 8 additions and 12 deletions
|
@ -211,11 +211,8 @@ Zotero.Sync.Storage = new function () {
|
||||||
|
|
||||||
if (updateItem) {
|
if (updateItem) {
|
||||||
// Update item date modified so the new mod time will be synced
|
// Update item date modified so the new mod time will be synced
|
||||||
var item = Zotero.Items.get(itemID);
|
var sql = "UPDATE items SET clientDateModified=? WHERE itemID=?";
|
||||||
//var date = new Date(mtime * 1000);
|
Zotero.DB.query(sql, [Zotero.DB.transactionDateTime, itemID]);
|
||||||
//item.setField('dateModified', Zotero.Date.dateToSQL(date, true));
|
|
||||||
item.setField('dateModified', Zotero.DB.transactionDateTime);
|
|
||||||
item.save();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Zotero.DB.commitTransaction();
|
Zotero.DB.commitTransaction();
|
||||||
|
@ -254,10 +251,9 @@ Zotero.Sync.Storage = new function () {
|
||||||
Zotero.DB.valueQuery(sql, [hash, itemID]);
|
Zotero.DB.valueQuery(sql, [hash, itemID]);
|
||||||
|
|
||||||
if (updateItem) {
|
if (updateItem) {
|
||||||
// Update item date modified so the new hash will be synced
|
// Update item date modified so the new mod time will be synced
|
||||||
var item = Zotero.Items.get(itemID);
|
var sql = "UPDATE items SET clientDateModified=? WHERE itemID=?";
|
||||||
item.setField('dateModified', Zotero.DB.transactionDateTime);
|
Zotero.DB.query(sql, [Zotero.DB.transactionDateTime, itemID]);
|
||||||
item.save();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Zotero.DB.commitTransaction();
|
Zotero.DB.commitTransaction();
|
||||||
|
|
|
@ -515,7 +515,7 @@ Zotero.Sync.Storage.Session.WebDAV.prototype._onUploadComplete = function (httpR
|
||||||
Zotero.Sync.Storage.setSyncedModificationTime(item.id, mtime, true);
|
Zotero.Sync.Storage.setSyncedModificationTime(item.id, mtime, true);
|
||||||
|
|
||||||
var hash = item.attachmentHash;
|
var hash = item.attachmentHash;
|
||||||
Zotero.Sync.Storage.setSyncedHash(item.id, hash, true);
|
Zotero.Sync.Storage.setSyncedHash(item.id, hash);
|
||||||
|
|
||||||
Zotero.DB.commitTransaction();
|
Zotero.DB.commitTransaction();
|
||||||
|
|
||||||
|
|
|
@ -633,12 +633,12 @@ Zotero.Sync.Storage.Session.ZFS.prototype._updateItemFileInfo = function (item)
|
||||||
|
|
||||||
// Store file mod time
|
// Store file mod time
|
||||||
var mtime = item.attachmentModificationTime;
|
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
|
// Store file hash of individual files
|
||||||
if (Zotero.Attachments.getNumFiles(item) == 1) {
|
if (Zotero.Attachments.getNumFiles(item) == 1) {
|
||||||
var hash = item.attachmentHash;
|
var hash = item.attachmentHash;
|
||||||
Zotero.Sync.Storage.setSyncedHash(item.id, hash, true);
|
Zotero.Sync.Storage.setSyncedHash(item.id, hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
Zotero.DB.commitTransaction();
|
Zotero.DB.commitTransaction();
|
||||||
|
|
Loading…
Reference in a new issue