Use `await using` in LocalizationService

pull/8511/head
Bogdan 1 year ago
parent abddce1cfa
commit 401edeabba

@ -146,21 +146,12 @@ namespace NzbDrone.Core.Localization
return;
}
using (var fs = File.OpenRead(resourcePath))
await using var fs = File.OpenRead(resourcePath);
var dict = await JsonSerializer.DeserializeAsync<Dictionary<string, string>>(fs);
foreach (var key in dict.Keys)
{
if (fs != null)
{
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);
}
dictionary[key] = dict[key];
}
}

Loading…
Cancel
Save