From d058237ba724c3fee842d90c04b1950c9efaadc0 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Tue, 13 Jul 2021 20:29:53 -0400 Subject: Duplicate scope check all models (#1810) * Add duplicateScopeCheckAllModels option to createNote * Add duplicateScopeCheckAllModels option * Add setting --- ext/js/data/anki-note-builder.js | 4 +++- ext/js/data/options-util.js | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'ext/js/data') diff --git a/ext/js/data/anki-note-builder.js b/ext/js/data/anki-note-builder.js index 621816d4..4bb3ddcb 100644 --- a/ext/js/data/anki-note-builder.js +++ b/ext/js/data/anki-note-builder.js @@ -41,6 +41,7 @@ class AnkiNoteBuilder { requirements=[], checkForDuplicates=true, duplicateScope='collection', + duplicateScopeCheckAllModels=false, resultOutputMode='split', glossaryLayoutMode='default', compactTags=false, @@ -98,7 +99,8 @@ class AnkiNoteBuilder { duplicateScope, duplicateScopeOptions: { deckName: duplicateScopeDeckName, - checkChildren: duplicateScopeCheckChildren + checkChildren: duplicateScopeCheckChildren, + checkAllModels: duplicateScopeCheckAllModels } } }; diff --git a/ext/js/data/options-util.js b/ext/js/data/options-util.js index 36630e2f..d131d0c6 100644 --- a/ext/js/data/options-util.js +++ b/ext/js/data/options-util.js @@ -856,7 +856,11 @@ class OptionsUtil { // Handlebars templates updated to use new media format. // Added {selection-text} field marker. // Added {sentence-furigana} field marker. + // Added anki.duplicateScopeCheckAllModels. await this._applyAnkiFieldTemplatesPatch(options, '/data/templates/anki-field-templates-upgrade-v13.handlebars'); + for (const profile of options.profiles) { + profile.options.anki.duplicateScopeCheckAllModels = false; + } return options; } } -- cgit v1.2.3