From 4f6ae9b981ca00e347bfcb3628c33499231c0eb1 Mon Sep 17 00:00:00 2001 From: rampaa Date: Fri, 15 Dec 2023 22:03:56 +0300 Subject: [PATCH] Minor --- JL.Core/Dicts/EDICT/ResourceUpdater.cs | 6 +++--- JL.Core/WordClass/JmdictWordClassUtils.cs | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/JL.Core/Dicts/EDICT/ResourceUpdater.cs b/JL.Core/Dicts/EDICT/ResourceUpdater.cs index 26321f8c..837097be 100644 --- a/JL.Core/Dicts/EDICT/ResourceUpdater.cs +++ b/JL.Core/Dicts/EDICT/ResourceUpdater.cs @@ -136,7 +136,7 @@ await Task.Run(async () => await JmdictLoader File.Delete(dbPath); } - if (useDB) + if (useDB || dbExists) { await Task.Run(() => { @@ -184,7 +184,7 @@ await Task.Run(async () => await JmnedictLoader File.Delete(dbPath); } - if (useDB) + if (useDB || dbExists) { await Task.Run(() => { @@ -232,7 +232,7 @@ await Task.Run(async () => await KanjidicLoader File.Delete(dbPath); } - if (useDB) + if (useDB || dbExists) { await Task.Run(() => { diff --git a/JL.Core/WordClass/JmdictWordClassUtils.cs b/JL.Core/WordClass/JmdictWordClassUtils.cs index 6966c0eb..59dfecc6 100644 --- a/JL.Core/WordClass/JmdictWordClassUtils.cs +++ b/JL.Core/WordClass/JmdictWordClassUtils.cs @@ -127,7 +127,9 @@ internal static async Task Initialize() if (!File.Exists(Path.Join(Utils.ResourcesPath, "PoS.json"))) { Dict dict = DictUtils.SingleDictTypeDicts[DictType.JMdict]; - if (dict.Active) + bool useDB = dict.Options?.UseDB?.Value ?? false; + + if (dict.Active && !useDB) { await Serialize().ConfigureAwait(false); }