mirror of
https://github.com/ankitects/anki.git
synced 2025-11-11 23:27:12 -05:00
remove deck overriding in text file import
This commit is contained in:
parent
e41c7738d3
commit
8fd1756eb4
1 changed files with 1 additions and 7 deletions
|
|
@ -35,7 +35,6 @@ class ForeignCard(object):
|
||||||
# ['Expression', 'Reading', '_tags', None]
|
# ['Expression', 'Reading', '_tags', None]
|
||||||
# - None means that the input should be discarded
|
# - None means that the input should be discarded
|
||||||
# - _tags maps to note tags
|
# - _tags maps to note tags
|
||||||
# - _deck maps to card deck
|
|
||||||
# If the first field of the model is not in the map, the map is invalid.
|
# If the first field of the model is not in the map, the map is invalid.
|
||||||
|
|
||||||
class NoteImporter(Importer):
|
class NoteImporter(Importer):
|
||||||
|
|
@ -64,10 +63,7 @@ class NoteImporter(Importer):
|
||||||
flds = [f['name'] for f in self.model['flds']]
|
flds = [f['name'] for f in self.model['flds']]
|
||||||
# truncate to provided count
|
# truncate to provided count
|
||||||
flds = flds[0:self.fields()]
|
flds = flds[0:self.fields()]
|
||||||
# if there's room left, add deck
|
# if there's room left, add tags
|
||||||
if self.fields() > len(flds):
|
|
||||||
flds.append("_deck")
|
|
||||||
# and tags
|
|
||||||
if self.fields() > len(flds):
|
if self.fields() > len(flds):
|
||||||
flds.append("_tags")
|
flds.append("_tags")
|
||||||
# and if there's still room left, pad
|
# and if there's still room left, pad
|
||||||
|
|
@ -188,8 +184,6 @@ where id = ? and (flds != ? or tags != ?)""", rows)
|
||||||
continue
|
continue
|
||||||
elif f == "_tags":
|
elif f == "_tags":
|
||||||
note.tags.extend(self.col.tags.split(note.fields[c]))
|
note.tags.extend(self.col.tags.split(note.fields[c]))
|
||||||
elif f == "_deck":
|
|
||||||
note.deck = note.fields[c]
|
|
||||||
else:
|
else:
|
||||||
sidx = self._fmap[f][0]
|
sidx = self._fmap[f][0]
|
||||||
fields[sidx] = note.fields[c]
|
fields[sidx] = note.fields[c]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue