We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dab52b6 commit 9647f39Copy full SHA for 9647f39
1 file changed
lib/chuko/api/anibis.ex
@@ -45,7 +45,8 @@ defmodule Chuko.Api.Anibis do
45
timeout: 300_000
46
)
47
|> Stream.flat_map(fn {:ok, res} -> res end)
48
- |> Enum.map(&cast_item/1)
+ |> Stream.map(&cast_item/1)
49
+ |> Enum.to_list()
50
rescue
51
err ->
52
Logger.error(Exception.format(:error, err, __STACKTRACE__))
@@ -80,9 +81,8 @@ defmodule Chuko.Api.Anibis do
80
81
Enum.map(urls, &(base_url <> String.replace(&1, "[size]", "1024x768/3/60")))
82
end
83
- defp format_image_urls(_, _) do
84
- []
85
- end
+ defp format_image_urls(nil, urls) when is_list(urls), do: urls
+ defp format_image_urls(_, _), do: []
86
87
defp parse_price(nil), do: 0.0
88
defp parse_price(price), do: price / 1
0 commit comments