mirror of https://github.com/lidarr/Lidarr
Deserialize asynchronously in LocalizationService
(cherry picked from commit 86a7f7bd54aa733b0e3abd3ec9463a85dd348118) Closes #3751
This commit is contained in:
parent
adcba7b724
commit
9bbf32a55c
|
@ -146,21 +146,12 @@ namespace NzbDrone.Core.Localization
|
|||
return;
|
||||
}
|
||||
|
||||
using (var fs = File.OpenRead(resourcePath))
|
||||
{
|
||||
if (fs != null)
|
||||
{
|
||||
var dict = await JsonSerializer.DeserializeAsync<Dictionary<string, string>>(fs);
|
||||
await using var fs = File.OpenRead(resourcePath);
|
||||
var dict = await JsonSerializer.DeserializeAsync<Dictionary<string, string>>(fs);
|
||||
|
||||
foreach (var key in dict.Keys)
|
||||
{
|
||||
dictionary[key] = dict[key];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.Error("Missing translation/culture resource: {0}", resourcePath);
|
||||
}
|
||||
foreach (var key in dict.Keys)
|
||||
{
|
||||
dictionary[key] = dict[key];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue