mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -07:00
Deserialize asynchronously in LocalizationService
(cherry picked from commit 86a7f7bd54aa733b0e3abd3ec9463a85dd348118) Closes #3751
This commit is contained in:
parent
adcba7b724
commit
9bbf32a55c
1 changed files with 5 additions and 14 deletions
|
@ -146,10 +146,7 @@ namespace NzbDrone.Core.Localization
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
using (var fs = File.OpenRead(resourcePath))
|
await using var fs = File.OpenRead(resourcePath);
|
||||||
{
|
|
||||||
if (fs != null)
|
|
||||||
{
|
|
||||||
var dict = await JsonSerializer.DeserializeAsync<Dictionary<string, string>>(fs);
|
var dict = await JsonSerializer.DeserializeAsync<Dictionary<string, string>>(fs);
|
||||||
|
|
||||||
foreach (var key in dict.Keys)
|
foreach (var key in dict.Keys)
|
||||||
|
@ -157,12 +154,6 @@ namespace NzbDrone.Core.Localization
|
||||||
dictionary[key] = dict[key];
|
dictionary[key] = dict[key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
_logger.Error("Missing translation/culture resource: {0}", resourcePath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string GetResourceFilename(string culture)
|
private static string GetResourceFilename(string culture)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue