mirror of
https://github.com/ankitects/anki.git
synced 2025-11-07 13:17:12 -05:00
don't bump mod time when importing apkg
This commit is contained in:
parent
78039891ce
commit
6d54a43060
1 changed files with 9 additions and 2 deletions
|
|
@ -22,6 +22,7 @@ class Anki2Importer(Importer):
|
||||||
|
|
||||||
needMapper = False
|
needMapper = False
|
||||||
deckPrefix = None
|
deckPrefix = None
|
||||||
|
allowUpdate = True
|
||||||
|
|
||||||
def run(self, media=None):
|
def run(self, media=None):
|
||||||
self._prepareFiles()
|
self._prepareFiles()
|
||||||
|
|
@ -82,15 +83,21 @@ class Anki2Importer(Importer):
|
||||||
existing[note[0]] = True
|
existing[note[0]] = True
|
||||||
# rewrite internal ids, models, etc
|
# rewrite internal ids, models, etc
|
||||||
note[2] = lmid
|
note[2] = lmid
|
||||||
note[3] = intTime()
|
|
||||||
note[4] = usn
|
note[4] = usn
|
||||||
add.append(note)
|
add.append(note)
|
||||||
dirty.append(note[0])
|
dirty.append(note[0])
|
||||||
# note we have the added note
|
# note we have the added note
|
||||||
self._notes[guid] = (note[0], note[3], note[2])
|
self._notes[guid] = (note[0], note[3], note[2])
|
||||||
else:
|
else:
|
||||||
# not yet implemented
|
|
||||||
pass
|
pass
|
||||||
|
## update existing note - not yet tested; for post 2.0
|
||||||
|
# newer = note[3] > mod
|
||||||
|
# if self.allowUpdate and self._mid(mid) == mid and newer:
|
||||||
|
# localNid = self._notes[guid][0]
|
||||||
|
# note[0] = localNid
|
||||||
|
# note[4] = usn
|
||||||
|
# add.append(note)
|
||||||
|
# dirty.append(note[0])
|
||||||
# add to col
|
# add to col
|
||||||
self.dst.db.executemany(
|
self.dst.db.executemany(
|
||||||
"insert or replace into notes values (?,?,?,?,?,?,?,?,?,?,?)",
|
"insert or replace into notes values (?,?,?,?,?,?,?,?,?,?,?)",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue