mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -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 c != s:
|
||||||
# if the sanity check failed, force a resync
|
# if the sanity check failed, force a resync
|
||||||
self.col.media.forceResync()
|
self.col.media.forceResync()
|
||||||
raise Exception("""\
|
return "sanityCheckFailed"
|
||||||
Media sanity check failed. Please copy and paste the text below:\n%s\n%s""" %
|
|
||||||
(c, s))
|
|
||||||
return "success"
|
|
||||||
|
|
||||||
def removed(self):
|
def removed(self):
|
||||||
return self.col.media.removed()
|
return self.col.media.removed()
|
||||||
|
|
|
@ -114,6 +114,10 @@ Please visit AnkiWeb, upgrade your deck, then try again."""))
|
||||||
self._clockOff()
|
self._clockOff()
|
||||||
elif evt == "checkFailed":
|
elif evt == "checkFailed":
|
||||||
self._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":
|
elif evt == "noChanges":
|
||||||
pass
|
pass
|
||||||
elif evt == "fullSync":
|
elif evt == "fullSync":
|
||||||
|
@ -382,6 +386,8 @@ class SyncThread(QThread):
|
||||||
ret = self.client.sync(self.mediaUsn)
|
ret = self.client.sync(self.mediaUsn)
|
||||||
if ret == "noChanges":
|
if ret == "noChanges":
|
||||||
self.fireEvent("noMediaChanges")
|
self.fireEvent("noMediaChanges")
|
||||||
|
elif ret == "sanityCheckFailed":
|
||||||
|
self.fireEvent("mediaSanity")
|
||||||
else:
|
else:
|
||||||
self.fireEvent("mediaSuccess")
|
self.fireEvent("mediaSuccess")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue