mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
favour most recent modified when importing template changes
This commit is contained in:
parent
e0d05e49d6
commit
645f6714d2
1 changed files with 6 additions and 7 deletions
|
@ -176,7 +176,6 @@ class Anki2Importer(Importer):
|
|||
# copy it over
|
||||
model = srcModel.copy()
|
||||
model['id'] = mid
|
||||
model['mod'] = intTime()
|
||||
model['usn'] = self.col.usn()
|
||||
self.dst.models.update(model)
|
||||
break
|
||||
|
@ -184,12 +183,12 @@ class Anki2Importer(Importer):
|
|||
dstModel = self.dst.models.get(mid)
|
||||
dstScm = self.dst.models.scmhash(dstModel)
|
||||
if srcScm == dstScm:
|
||||
# they do; we can reuse this mid
|
||||
model = srcModel.copy()
|
||||
model['id'] = mid
|
||||
model['mod'] = intTime()
|
||||
model['usn'] = self.col.usn()
|
||||
self.dst.models.update(model)
|
||||
# copy styling changes over if newer
|
||||
if srcModel['mod'] > dstModel['mod']:
|
||||
model = srcModel.copy()
|
||||
model['id'] = mid
|
||||
model['usn'] = self.col.usn()
|
||||
self.dst.models.update(model)
|
||||
break
|
||||
# as they don't match, try next id
|
||||
mid += 1
|
||||
|
|
Loading…
Reference in a new issue