Skip to content

Commit

Permalink
Fix Evernote seeing first 250 notes only
Browse files Browse the repository at this point in the history
  • Loading branch information
KostyaEsmukov committed Aug 5, 2016
1 parent e5f2245 commit 281e55a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
CHANGELOG
=========

2.0.1 (2016-08-05)
------------------

* Fix Evernote seeing first 250 notes only


2.0.0 (2016-08-04)
------------------

Expand Down
30 changes: 18 additions & 12 deletions synctogit/Evernote.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,20 +149,26 @@ def _get_all_notes_metadata(self):
spec.includeUpdated = True
spec.includeDeleted = True

metadata = note_store.findNotesMetadata(noteFilter, 0, Constants.EDAM_USER_NOTES_MAX, spec)

res = {}
offset = 0
while True:

metadata = note_store.findNotesMetadata(noteFilter, offset, Constants.EDAM_USER_NOTES_MAX, spec)

for n in metadata.notes:
res[n.guid] = {
'title': n.title,
'notebookGuid': n.notebookGuid,
'updateSequenceNum': n.updateSequenceNum,
'tagGuids': n.tagGuids,
'updated': n.updated,
'created': n.created,
'deleted': n.deleted
}

for n in metadata.notes:
res[n.guid] = {
'title': n.title,
'notebookGuid': n.notebookGuid,
'updateSequenceNum': n.updateSequenceNum,
'tagGuids': n.tagGuids,
'updated': n.updated,
'created': n.created,
'deleted': n.deleted
}
offset = metadata.startIndex + len(metadata.notes)
if offset >= metadata.totalNotes:
break

return res, self._get_notebooks()

Expand Down
2 changes: 1 addition & 1 deletion synctogit/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.0.0'
__version__ = '2.0.1'

0 comments on commit 281e55a

Please sign in to comment.