Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rampaa committed Dec 16, 2023
1 parent ab28796 commit 607bc6f
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 6 deletions.
5 changes: 5 additions & 0 deletions JL.Core/Dicts/DictUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ public static async Task LoadDictionaries()

if (dbJournalExists)
{
SqliteConnection.ClearAllPools();
File.Delete(dbJournalPath);
if (dbExists)
{
Expand Down Expand Up @@ -861,6 +862,7 @@ public static async Task LoadDictionaries()

if (dbExists)
{
SqliteConnection.ClearAllPools();
File.Delete(dbPath);
}
}
Expand Down Expand Up @@ -939,6 +941,7 @@ public static async Task LoadDictionaries()

if (dbExists)
{
SqliteConnection.ClearAllPools();
File.Delete(dbPath);
}
}
Expand Down Expand Up @@ -1107,6 +1110,7 @@ dict.Type is DictType.CustomNameDictionary

if (dbExists)
{
SqliteConnection.ClearAllPools();
File.Delete(dbPath);
}
}
Expand Down Expand Up @@ -1186,6 +1190,7 @@ dict.Type is DictType.CustomNameDictionary

if (dbExists)
{
SqliteConnection.ClearAllPools();
File.Delete(dbPath);
}
}
Expand Down
2 changes: 0 additions & 2 deletions JL.Core/Dicts/EPWING/EpwingUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ public static bool IsValidEpwingResultForDictType(string primarySpelling, string
}
}

definitions = definitions.Select(static def => def.Replace("┏", "", StringComparison.Ordinal)).ToArray();

break;

case DictType.Daijisen:
Expand Down
2 changes: 1 addition & 1 deletion JL.Core/Dicts/EPWING/Nazeka/EpwingNazekaLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static async Task Load(Dict dict)
string? definition = definitionJsonElement.GetString();
if (!string.IsNullOrWhiteSpace(definition))
{
if (dict.Type is DictType.Kenkyuusha)
if (dict.Type is DictType.KenkyuushaNazeka)
{
definition = definition.Replace("┏", "", StringComparison.Ordinal);
}
Expand Down
4 changes: 3 additions & 1 deletion JL.Core/Dicts/EPWING/Yomichan/EpwingYomichanLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ private static void AddToDictionary(IEpwingRecord yomichanRecord, Dict dict)
dict.Contents[hiraganaExpression] = new List<IDictRecord> { yomichanRecord };
}

if (dict.Type is not DictType.NonspecificNameYomichan and not DictType.NonspecificKanjiWithWordSchemaYomichan and not DictType.KanjigenYomichan
if (dict.Type is not DictType.NonspecificNameYomichan
and not DictType.NonspecificKanjiWithWordSchemaYomichan
and not DictType.KanjigenYomichan
&& !string.IsNullOrEmpty(yomichanRecord.Reading))
{
string hiraganaReading = JapaneseUtils.KatakanaToHiragana(yomichanRecord.Reading);
Expand Down
3 changes: 3 additions & 0 deletions JL.Core/Freqs/FreqUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public static async Task LoadFrequencies()

if (dbJournalExists)
{
SqliteConnection.ClearAllPools();
File.Delete(dbJournalPath);
if (dbExists)
{
Expand Down Expand Up @@ -123,6 +124,7 @@ public static async Task LoadFrequencies()

if (dbExists)
{
SqliteConnection.ClearAllPools();
File.Delete(dbPath);
}
}
Expand Down Expand Up @@ -198,6 +200,7 @@ public static async Task LoadFrequencies()

if (dbExists)
{
SqliteConnection.ClearAllPools();
File.Delete(dbPath);
}
}
Expand Down
2 changes: 1 addition & 1 deletion JL.Windows/GUI/ManageDictionariesWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ and not DictType.Kanjidic
dict.Contents.TrimExcess();
_ = DictUtils.Dicts.Remove(dict.Name);

string dbPath = DictUtils.GetDBPath(dict.Path);
string dbPath = DictUtils.GetDBPath(dict.Name);
if (File.Exists(dbPath))
{
SqliteConnection.ClearAllPools();
Expand Down
2 changes: 1 addition & 1 deletion JL.Windows/GUI/ManageFrequenciesWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ private void UpdateFreqsDisplay()
freq.Contents.TrimExcess();
_ = FreqUtils.FreqDicts.Remove(freq.Name);

string dbPath = FreqUtils.GetDBPath(freq.Path);
string dbPath = FreqUtils.GetDBPath(freq.Name);
if (File.Exists(dbPath))
{
SqliteConnection.ClearAllPools();
Expand Down

0 comments on commit 607bc6f

Please sign in to comment.