Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
rampaa committed Dec 10, 2023
1 parent 724277e commit 94cfa31
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
19 changes: 13 additions & 6 deletions JL.Core/Dicts/DictUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -567,10 +567,12 @@ public static async Task LoadDictionaries()
if (loadFromDB)
{
JmdictDBManager.LoadFromDB(dict);
dict.Size = dict.Contents.Count;
}
else
{
await JmdictLoader.Load(dict).ConfigureAwait(false);
dict.Size = dict.Contents.Count;

if (useDB && !dbExists)
{
Expand All @@ -581,7 +583,6 @@ public static async Task LoadDictionaries()
}
}

dict.Size = dict.Contents.Count;
dict.Ready = true;
});

Expand Down Expand Up @@ -672,10 +673,12 @@ public static async Task LoadDictionaries()
if (loadFromDB)
{
KanjidicDBManager.LoadFromDB(dict);
dict.Size = dict.Contents.Count;
}
else
{
await KanjidicLoader.Load(dict).ConfigureAwait(false);
dict.Size = dict.Contents.Count;

if (useDB && !dbExists)
{
Expand All @@ -686,7 +689,6 @@ public static async Task LoadDictionaries()
}
}

dict.Size = dict.Contents.Count;
dict.Ready = true;
}));
}
Expand Down Expand Up @@ -774,10 +776,12 @@ public static async Task LoadDictionaries()
if (loadFromDB)
{
EpwingYomichanDBManager.LoadFromDB(dict);
dict.Size = dict.Contents.Count;
}
else
{
await EpwingYomichanLoader.Load(dict).ConfigureAwait(false);
dict.Size = dict.Contents.Count;

if (useDB && !dbExists)
{
Expand All @@ -788,7 +792,6 @@ public static async Task LoadDictionaries()
}
}

dict.Size = dict.Contents.Count;
dict.Ready = true;
}

Expand Down Expand Up @@ -841,10 +844,12 @@ public static async Task LoadDictionaries()
if (loadFromDB)
{
YomichanKanjiDBManager.LoadFromDB(dict);
dict.Size = dict.Contents.Count;
}
else
{
await YomichanKanjiLoader.Load(dict).ConfigureAwait(false);
dict.Size = dict.Contents.Count;

if (useDB && !dbExists)
{
Expand All @@ -855,7 +860,6 @@ public static async Task LoadDictionaries()
}
}

dict.Size = dict.Contents.Count;
dict.Ready = true;
}

Expand Down Expand Up @@ -999,10 +1003,12 @@ dict.Type is DictType.CustomNameDictionary
if (loadFromDB)
{
EpwingNazekaDBManager.LoadFromDB(dict);
dict.Size = dict.Contents.Count;
}
else
{
await EpwingNazekaLoader.Load(dict).ConfigureAwait(false);
dict.Size = dict.Contents.Count;

if (useDB && !dbExists)
{
Expand All @@ -1013,7 +1019,6 @@ dict.Type is DictType.CustomNameDictionary
}
}

dict.Size = dict.Contents.Count;
dict.Ready = true;
}

Expand Down Expand Up @@ -1066,10 +1071,13 @@ dict.Type is DictType.CustomNameDictionary
if (loadFromDB)
{
EpwingYomichanDBManager.LoadFromDB(dict);
dict.Size = dict.Contents.Count;
}
else
{
await YomichanPitchAccentLoader.Load(dict).ConfigureAwait(false);
dict.Size = dict.Contents.Count;

if (useDB && !dbExists)
{
YomichanPitchAccentDBManager.CreateDB(dict.Name);
Expand All @@ -1079,7 +1087,6 @@ dict.Type is DictType.CustomNameDictionary
}
}

dict.Size = dict.Contents.Count;
dict.Ready = true;
}

Expand Down
6 changes: 4 additions & 2 deletions JL.Core/Freqs/FreqUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,12 @@ public static async Task LoadFrequencies()
if (loadFromDB)
{
FreqDBManager.LoadFromDB(freq);
freq.Size = freq.Contents.Count;
}
else
{
await FrequencyNazekaLoader.Load(freq).ConfigureAwait(false);
freq.Size = freq.Contents.Count;

if (useDB && !dbExists)
{
Expand All @@ -108,7 +110,6 @@ public static async Task LoadFrequencies()
}
}

freq.Size = freq.Contents.Count;
freq.Ready = true;
}

Expand Down Expand Up @@ -167,10 +168,12 @@ public static async Task LoadFrequencies()
if (loadFromDB)
{
FreqDBManager.LoadFromDB(freq);
freq.Size = freq.Contents.Count;
}
else
{
await FrequencyYomichanLoader.Load(freq).ConfigureAwait(false);
freq.Size = freq.Contents.Count;

if (useDB && !dbExists)
{
Expand All @@ -181,7 +184,6 @@ public static async Task LoadFrequencies()
}
}

freq.Size = freq.Contents.Count;
freq.Ready = true;
}

Expand Down

0 comments on commit 94cfa31

Please sign in to comment.