Fix additional translatorCache problems at startup

This commit is contained in:
Dan Stillman 2018-09-25 06:24:17 -04:00
parent 10ca281c47
commit 3a8fd4d942

View file

@ -782,9 +782,12 @@ Zotero.Schema = new function(){
// If there's anything in the cache, see what we actually need to extract // If there's anything in the cache, see what we actually need to extract
for (let i = 0; i < rows.length; i++) { for (let i = 0; i < rows.length; i++) {
let json = rows[i].metadataJSON; let json = rows[i].metadataJSON;
let metadata;
try { try {
metadata = JSON.parse(json); let metadata = JSON.parse(json);
let id = metadata.translatorID;
if (index[id] && index[id].lastUpdated <= metadata.lastUpdated) {
index[id].extract = false;
}
} }
catch (e) { catch (e) {
Zotero.logError(e); Zotero.logError(e);
@ -795,11 +798,6 @@ Zotero.Schema = new function(){
"DELETE FROM translatorCache WHERE rowid=?", "DELETE FROM translatorCache WHERE rowid=?",
rows[i].rowid rows[i].rowid
); );
continue;
}
let id = metadata.translatorID;
if (index[id] && index[id].lastUpdated <= metadata.lastUpdated) {
index[id].extract = false;
} }
} }