Various refactoring and typespec improvements

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-09-24 16:46:42 +02:00
parent d235653876
commit 1893d9f55b
142 changed files with 1854 additions and 1297 deletions

View File

@@ -192,7 +192,7 @@ defmodule Mobilizon.Service.RichMedia.Parser do
end
end
@spec maybe_parse(String.t()) :: {:halt, map()} | {:cont, map()}
@spec maybe_parse(String.t()) :: map()
defp maybe_parse(html) do
Enum.reduce_while(parsers(), %{}, fn parser, acc ->
case parser.parse(html, acc) do
@@ -286,7 +286,7 @@ defmodule Mobilizon.Service.RichMedia.Parser do
end
end
@spec check_remote_picture_path(map()) :: map()
@spec check_remote_picture_path(map()) :: {:ok, map()}
defp check_remote_picture_path(%{image_remote_url: image_remote_url, url: url} = data)
when is_binary(image_remote_url) and is_binary(url) do
Logger.debug("Checking image_remote_url #{image_remote_url}")