Skip to content

Commit 9647f39

Browse files
committed
fix anibis images from autoscout
1 parent dab52b6 commit 9647f39

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/chuko/api/anibis.ex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ defmodule Chuko.Api.Anibis do
4545
timeout: 300_000
4646
)
4747
|> Stream.flat_map(fn {:ok, res} -> res end)
48-
|> Enum.map(&cast_item/1)
48+
|> Stream.map(&cast_item/1)
49+
|> Enum.to_list()
4950
rescue
5051
err ->
5152
Logger.error(Exception.format(:error, err, __STACKTRACE__))
@@ -80,9 +81,8 @@ defmodule Chuko.Api.Anibis do
8081
Enum.map(urls, &(base_url <> String.replace(&1, "[size]", "1024x768/3/60")))
8182
end
8283

83-
defp format_image_urls(_, _) do
84-
[]
85-
end
84+
defp format_image_urls(nil, urls) when is_list(urls), do: urls
85+
defp format_image_urls(_, _), do: []
8686

8787
defp parse_price(nil), do: 0.0
8888
defp parse_price(price), do: price / 1

0 commit comments

Comments
 (0)