From 30cbe0e1da33b8eeee480619c5720abfc3e2ecf6 Mon Sep 17 00:00:00 2001 From: praschke Date: Fri, 13 Oct 2023 13:14:56 +0100 Subject: add sort dictionary data to parse results on the search page this is based on forsakeninfinity's commit https://github.com/forsakeninfinity/yomibaba/commit/c9887d51ed5c917bb900d7964614154de1d76872 --- ext/js/language/translator.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ext/js/language') diff --git a/ext/js/language/translator.js b/ext/js/language/translator.js index edb38bfb..3b47cc51 100644 --- a/ext/js/language/translator.js +++ b/ext/js/language/translator.js @@ -93,6 +93,12 @@ class Translator { } if (mode === 'simple') { + if (sortFrequencyDictionary !== null) { + const sortDictionaryMap = [sortFrequencyDictionary] + .filter((key) => enabledDictionaryMap.has(key)) + .reduce((subMap, key) => subMap.set(key, enabledDictionaryMap.get(key)), new Map()); + await this._addTermMeta(dictionaryEntries, sortDictionaryMap); + } this._clearTermTags(dictionaryEntries); } else { await this._addTermMeta(dictionaryEntries, enabledDictionaryMap); -- cgit v1.2.3