On 12/31/12 2:18 PM, Robin Wilson wrote:
> The new version does things in a far more intelligent way - it looks
> at what has changed, and then removes the relevant entries from the
> BibTeX file and exports anything that needs exporting (rather than
> exporting all items). There is a bit more to it than that, as due to
> the way that BibTeX keys work, we need to delete and then re-export
> all items with a certain first-author/year combination whenever one of
> them changes (this is the only way of doing it so that it doesn't
> break things with BibTeX). Anyway, as part of this I need to look at
> all 'modify' events and see whether the author and/or year was changed
> - and that's what I'm using extraData for.
>
> So, basically I'm just using the 'old' field of extraData to see what
> has changed in the 'modify' event, and so I can deal with things
> properly. In the future I'd like to make things even more efficient by
> only processing the event at all if one of the BibTeX relevant fields
> (such as title, creators, date, journalTitle etc - and not including
> things like attachments, related items, tags etc) has changed.
Haven't decided on this yet, but it sounds like it'd be sufficient for
the 'modify' event to include just the fields that changed (with their
values) rather than the entire previous object?
I haven't tested this in a while, but I suspect serializing the entire
object to 'old' is actually slowing some parts of Zotero down quite a
bit. There shouldn't be much of a performance penalty to store just the
previous values of the fields that changed, though.
Zotero extensions also then wouldn't need to compare the two objects
themselves to see what changed.