mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
move using to more specific place in Google.cs
This commit is contained in:
parent
919d5d51ab
commit
1003ce4160
1 changed files with 15 additions and 15 deletions
|
|
@ -32,24 +32,24 @@ namespace Flow.Launcher.Plugin.WebSearch.SuggestionSources
|
|||
return new List<string>();
|
||||
}
|
||||
|
||||
using (resultStream)
|
||||
|
||||
if (resultStream.Length == 0) return new List<string>();
|
||||
JsonDocument json;
|
||||
try
|
||||
{
|
||||
if (resultStream.Length == 0) return new List<string>();
|
||||
JsonDocument json;
|
||||
try
|
||||
{
|
||||
using (resultStream)
|
||||
json = await JsonDocument.ParseAsync(resultStream);
|
||||
}
|
||||
catch (JsonException e)
|
||||
{
|
||||
Log.Exception("|Google.Suggestions|can't parse suggestions", e);
|
||||
return new List<string>();
|
||||
}
|
||||
|
||||
var results = json?.RootElement.EnumerateArray().ElementAt(1);
|
||||
|
||||
return results?.EnumerateArray().Select(o => o.GetString()).ToList() ?? new List<string>();
|
||||
}
|
||||
catch (JsonException e)
|
||||
{
|
||||
Log.Exception("|Google.Suggestions|can't parse suggestions", e);
|
||||
return new List<string>();
|
||||
}
|
||||
|
||||
var results = json?.RootElement.EnumerateArray().ElementAt(1);
|
||||
|
||||
return results?.EnumerateArray().Select(o => o.GetString()).ToList() ?? new List<string>();
|
||||
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
|
|
|
|||
Loading…
Reference in a new issue