autosync media on startup

This commit is contained in:
Damien Elmes 2020-02-05 11:55:46 +10:00
parent fdd850c0f0
commit 59a7993011

View file

@ -344,6 +344,8 @@ close the profile or restart Anki."""
if not self.loadCollection():
return
self.maybe_auto_sync_media()
self.pm.apply_profile_options()
# show main window
@ -856,6 +858,11 @@ title="%s" %s>%s</button>""" % (
# ok to sync
self._sync()
def maybe_auto_sync_media(self) -> None:
if not self.pm.profile["autoSync"] or self.safeMode or self.restoringBackup:
return
self.media_syncer.start()
def _sync(self):
from aqt.sync import SyncManager