Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
rampaa committed Dec 14, 2024
1 parent 02d3356 commit fd37353
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions JL.Core/Mining/MiningUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -749,17 +749,18 @@ public static async Task MineToFile(LookupResult lookupResult, string currentTex
for (int i = 0; i < lookupResults.Length; i++)
{
LookupResult lookupResult = lookupResults[i];
DictType dictType = lookupResult.Dict.Type;

AnkiConfig? ankiConfig;
if (DictUtils.s_wordDictTypes.Contains(lookupResult.Dict.Type))
if (DictUtils.s_wordDictTypes.Contains(dictType))
{
ankiConfig = ankiConfigDict.GetValueOrDefault(MineType.Word);
}
else if (DictUtils.s_kanjiDictTypes.Contains(lookupResult.Dict.Type))
else if (DictUtils.s_kanjiDictTypes.Contains(dictType))
{
ankiConfig = ankiConfigDict.GetValueOrDefault(MineType.Kanji);
}
else if (DictUtils.s_nameDictTypes.Contains(lookupResult.Dict.Type))
else if (DictUtils.s_nameDictTypes.Contains(dictType))
{
ankiConfig = ankiConfigDict.GetValueOrDefault(MineType.Name);
}
Expand Down Expand Up @@ -796,15 +797,15 @@ public static async Task MineToFile(LookupResult lookupResult, string currentTex
return null;
}

List<bool>? canAddNote = await AnkiUtils.CanAddNotes(notes).ConfigureAwait(false);
if (canAddNote is null)
List<bool>? canAddNoteList = await AnkiUtils.CanAddNotes(notes).ConfigureAwait(false);
if (canAddNoteList is null)
{
return null;
}

for (int i = 0; i < canAddNote.Count; i++)
for (int i = 0; i < canAddNoteList.Count; i++)
{
results[positions[i]] = !canAddNote[i];
results[positions[i]] = !canAddNoteList[i];
}

return results;
Expand Down

0 comments on commit fd37353

Please sign in to comment.