188BET靠谱吗On Contents' Notes created by Zotfile in Zotero database
I discovered through
188BET靠谱吗https://forums.zotero.org/discussion/70958/the-note-is-too-long-to-sync-shorten-the-note-and-sync-againthat ZotFile auto-extract PDF table of contents using PDF bookmarks (thanks
@adamsmith).
188BET靠谱吗In Zotero, these notes do appear neither as notes nor as annotations to the corresponding attachment, so they cannot be deleted.
188BET靠谱吗Looking at Zotero database (zotero.sqlite), It seems there is a pattern (I've just seen a few of these notes).They are saved in itemNotes table (so, they are notes) without a parentItemID (NULL value) and with itemID the same that the corresponding attachment itemID in itemAttachments table.
So, I have a couple of questions.
Are all the notes (itemNotes) with NULL parentItemID of this type (ZotFile bookmarks notes), or may there be other such notes not related to ZotFile?So, would it be safe to delete all such notes?
Isn't this behaviour a bug in ZotFile processing, so should it built notes with parentItemID (and maybe a distinct itemID)?
188BET靠谱吗In Zotero, these notes do appear neither as notes nor as annotations to the corresponding attachment, so they cannot be deleted.
188BET靠谱吗Looking at Zotero database (zotero.sqlite), It seems there is a pattern (I've just seen a few of these notes).They are saved in itemNotes table (so, they are notes) without a parentItemID (NULL value) and with itemID the same that the corresponding attachment itemID in itemAttachments table.
So, I have a couple of questions.
Are all the notes (itemNotes) with NULL parentItemID of this type (ZotFile bookmarks notes), or may there be other such notes not related to ZotFile?So, would it be safe to delete all such notes?
Isn't this behaviour a bug in ZotFile processing, so should it built notes with parentItemID (and maybe a distinct itemID)?
188BET靠谱吗So, if you're delete all entries in the itemNotes table with parentItemID 'NULL' you will lose Zotero notes on item attachments too.If you have such notes.
Do a simple test ( on your own risk!): 188BET靠谱吗make a backup copy of zotero.sqlite fileand switch off auto-syncing.Now delete what you want to delete.188BET靠谱吗Afterwards start Zotero again and see what you're missing.If you don't miss anything, fine.188BET靠谱吗If you're missing something: delete the zotero.sqlite file and take the backup file instead and everything is as before.
Searching for
"Contents"
(with quotes) in All Fields & Tags mode should show you all of the affected notes.If you want to delete them, you can use this code in Tools → Developer → Run JavaScript:
188BET靠谱吗var itemIDs = await Zotero.DB.columnQueryAsync("SELECT itemID FROM items JOIN itemNotes USING (itemID) WHERE libraryID=1 AND itemTypeID=(SELECT itemTypeID FROM itemTypes WHERE typeName='attachment') AND note LIKE ?", "%Contents%");
for (let itemID of itemIDs) {
188BET靠谱吗let item = Zotero.Items.get(itemID);
item.setNote("");
await item.saveTx();
}
188BET靠谱吗You should make a backup of zotero.sqlite and turn off auto-sync first.
Don't make direct changes to your database via SQL.