www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit ddca12ba26a43cfaca25fbb172a14261a09b8dcd
parent ff68789e4eabde730b216bcf5bcec9f15166ad04
Author: Dan Stillman <dstillman@zotero.org>
Date:   Fri, 22 Jul 2011 22:41:42 +0000

Match only books by ISBN, since book sections shouldn't be merged


Diffstat:
Mchrome/content/zotero/xpcom/duplicates.js | 18+++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/chrome/content/zotero/xpcom/duplicates.js b/chrome/content/zotero/xpcom/duplicates.js @@ -180,8 +180,24 @@ Zotero.Duplicates.prototype._findDuplicates = function () { return a == b ? 1 : -1; }); + // Match books by ISBN + var sql = "SELECT itemID, value FROM items JOIN itemData USING (itemID) " + + "JOIN itemDataValues USING (valueID) " + + "WHERE libraryID=? AND itemTypeID=? AND fieldID=? " + + "AND itemID NOT IN (SELECT itemID FROM deletedItems) " + + "ORDER BY value"; + var rows = Zotero.DB.query( + sql, + [ + this._libraryID, + Zotero.ItemTypes.getID('book'), + Zotero.ItemFields.getID('ISBN') + ] + ); + processRows(); + // Match on exact fields - var fields = ['DOI', 'ISBN']; + var fields = ['DOI']; for each(var field in fields) { var sql = "SELECT itemID, value FROM items JOIN itemData USING (itemID) " + "JOIN itemDataValues USING (valueID) "