mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
skip add/replace prompt when importing 1-deck apkg
This commit is contained in:
parent
9e74f81fa4
commit
c64f5130e2
1 changed files with 11 additions and 0 deletions
|
@ -315,6 +315,17 @@ Unable to import from a read-only file."""))
|
||||||
mw.reset()
|
mw.reset()
|
||||||
|
|
||||||
def setupApkgImport(mw, importer):
|
def setupApkgImport(mw, importer):
|
||||||
|
meta = None
|
||||||
|
try:
|
||||||
|
z = zipfile.ZipFile(importer.file)
|
||||||
|
meta = json.load(z.open("meta"))
|
||||||
|
if not meta['full']:
|
||||||
|
# add
|
||||||
|
return True
|
||||||
|
except:
|
||||||
|
# no meta attribute on broken file
|
||||||
|
pass
|
||||||
|
# if old file or full collection, we have to prompt user
|
||||||
diag = askUserDialog(_("""\
|
diag = askUserDialog(_("""\
|
||||||
Would you like to add to your collection, or replace it?"""),
|
Would you like to add to your collection, or replace it?"""),
|
||||||
[_("Add"),
|
[_("Add"),
|
||||||
|
|
Loading…
Reference in a new issue