mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
never set lastSync=0 when toggling syncing
we should rely on needFullSync() to determine whether a full sync is actually necessary.
This commit is contained in:
parent
d362decca2
commit
e0d5b9d69e
1 changed files with 4 additions and 9 deletions
13
anki/deck.py
13
anki/deck.py
|
@ -3163,16 +3163,12 @@ Return new path, relative to media dir."""
|
||||||
# toggling does not bump deck mod time, since it may happen on upgrade,
|
# toggling does not bump deck mod time, since it may happen on upgrade,
|
||||||
# and the variable is not synced
|
# and the variable is not synced
|
||||||
|
|
||||||
def enableSyncing(self, ls=True):
|
def enableSyncing(self):
|
||||||
self.syncName = unicode(checksum(self.path.encode("utf-8")))
|
self.syncName = unicode(checksum(self.path.encode("utf-8")))
|
||||||
if ls:
|
|
||||||
self.lastSync = 0
|
|
||||||
self.s.commit()
|
self.s.commit()
|
||||||
|
|
||||||
def disableSyncing(self, ls=True):
|
def disableSyncing(self):
|
||||||
self.syncName = None
|
self.syncName = None
|
||||||
if ls:
|
|
||||||
self.lastSync = 0
|
|
||||||
self.s.commit()
|
self.s.commit()
|
||||||
|
|
||||||
def syncingEnabled(self):
|
def syncingEnabled(self):
|
||||||
|
@ -3187,7 +3183,6 @@ has been disabled (ERR-0100).
|
||||||
You can disable this check in Settings>Preferences>Network.""") % self.name())
|
You can disable this check in Settings>Preferences>Network.""") % self.name())
|
||||||
self.disableSyncing()
|
self.disableSyncing()
|
||||||
self.syncName = None
|
self.syncName = None
|
||||||
self.lastSync = 0
|
|
||||||
|
|
||||||
# DB maintenance
|
# DB maintenance
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
@ -4314,9 +4309,9 @@ syncing again via Settings>Deck Properties>Synchronisation.
|
||||||
If you have syncing disabled in the preferences, you can ignore \
|
If you have syncing disabled in the preferences, you can ignore \
|
||||||
this message. (ERR-0101)""") % {
|
this message. (ERR-0101)""") % {
|
||||||
'sname':sname, 'dname':dname})
|
'sname':sname, 'dname':dname})
|
||||||
deck.disableSyncing(ls=False)
|
deck.disableSyncing()
|
||||||
elif sname:
|
elif sname:
|
||||||
deck.enableSyncing(ls=False)
|
deck.enableSyncing()
|
||||||
deck.version = 52
|
deck.version = 52
|
||||||
deck.s.commit()
|
deck.s.commit()
|
||||||
if deck.version < 53:
|
if deck.version < 53:
|
||||||
|
|
Loading…
Reference in a new issue