mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
better msg when media sanity fails
This commit is contained in:
parent
9714143af9
commit
be78c3f9e3
2 changed files with 7 additions and 4 deletions
|
@ -703,10 +703,7 @@ class MediaSyncer(object):
|
|||
if c != s:
|
||||
# if the sanity check failed, force a resync
|
||||
self.col.media.forceResync()
|
||||
raise Exception("""\
|
||||
Media sanity check failed. Please copy and paste the text below:\n%s\n%s""" %
|
||||
(c, s))
|
||||
return "success"
|
||||
return "sanityCheckFailed"
|
||||
|
||||
def removed(self):
|
||||
return self.col.media.removed()
|
||||
|
|
|
@ -114,6 +114,10 @@ Please visit AnkiWeb, upgrade your deck, then try again."""))
|
|||
self._clockOff()
|
||||
elif evt == "checkFailed":
|
||||
self._checkFailed()
|
||||
elif evt == "mediaSanity":
|
||||
showWarning(_("""\
|
||||
A problem occurred while syncing media. Please sync again and Anki will \
|
||||
correct the issue."""))
|
||||
elif evt == "noChanges":
|
||||
pass
|
||||
elif evt == "fullSync":
|
||||
|
@ -382,6 +386,8 @@ class SyncThread(QThread):
|
|||
ret = self.client.sync(self.mediaUsn)
|
||||
if ret == "noChanges":
|
||||
self.fireEvent("noMediaChanges")
|
||||
elif ret == "sanityCheckFailed":
|
||||
self.fireEvent("mediaSanity")
|
||||
else:
|
||||
self.fireEvent("mediaSuccess")
|
||||
|
||||
|
|
Loading…
Reference in a new issue