mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 22:42:25 -04:00
make sure users can unload corrupt collection to create new profile
This commit is contained in:
parent
06b61fc2c7
commit
e5a2a9c3f8
1 changed files with 10 additions and 5 deletions
15
aqt/main.py
15
aqt/main.py
|
@ -303,12 +303,17 @@ Debug info:
|
||||||
if self.col:
|
if self.col:
|
||||||
if not self.closeAllCollectionWindows():
|
if not self.closeAllCollectionWindows():
|
||||||
return
|
return
|
||||||
self.maybeOptimize()
|
|
||||||
self.progress.start(immediate=True)
|
self.progress.start(immediate=True)
|
||||||
if os.getenv("ANKIDEV", 0):
|
corrupt = False
|
||||||
corrupt = False
|
try:
|
||||||
else:
|
self.maybeOptimize()
|
||||||
corrupt = self.col.db.scalar("pragma integrity_check") != "ok"
|
except:
|
||||||
|
corrupt = True
|
||||||
|
if not corrupt:
|
||||||
|
if os.getenv("ANKIDEV", 0):
|
||||||
|
corrupt = False
|
||||||
|
else:
|
||||||
|
corrupt = self.col.db.scalar("pragma integrity_check") != "ok"
|
||||||
if corrupt:
|
if corrupt:
|
||||||
showWarning(_("Your collection file appears to be corrupt. \
|
showWarning(_("Your collection file appears to be corrupt. \
|
||||||
This can happen when the file is copied or moved while Anki is open, or \
|
This can happen when the file is copied or moved while Anki is open, or \
|
||||||
|
|
Loading…
Reference in a new issue