moveTemplate slightly quicker
When a template is moved, only move the ord of cards whose position did change.
This commit is contained in:
parent
2a539cda1b
commit
b29fd508c7
@ -397,7 +397,10 @@ update cards set ord = ord - 1, usn = ?, mod = ?
|
|||||||
# generate change map
|
# generate change map
|
||||||
map = []
|
map = []
|
||||||
for t in m['tmpls']:
|
for t in m['tmpls']:
|
||||||
map.append("when ord = %d then %d" % (oldidxs[id(t)], t['ord']))
|
oldidx = oldidxs[id(t)]
|
||||||
|
newidx = t['ord']
|
||||||
|
if oldidx != newidx:
|
||||||
|
map.append("when ord = %d then %d" % (oldidx, newidx))
|
||||||
# apply
|
# apply
|
||||||
self.save(m)
|
self.save(m)
|
||||||
self.col.db.execute("""
|
self.col.db.execute("""
|
||||||
|
Loading…
Reference in New Issue
Block a user