rich media parser ttl files consistency
authorAlexander Strizhakov <alex.strizhakov@gmail.com>
Tue, 23 Jun 2020 15:33:03 +0000 (18:33 +0300)
committerAlexander Strizhakov <alex.strizhakov@gmail.com>
Tue, 13 Oct 2020 13:38:15 +0000 (16:38 +0300)
lib/pleroma/web/rich_media/parser/ttl.ex [moved from lib/pleroma/web/rich_media/parsers/ttl/ttl.ex with 71% similarity]
lib/pleroma/web/rich_media/parser/ttl/aws_signed_url.ex [moved from lib/pleroma/web/rich_media/parsers/ttl/aws_signed_url.ex with 96% similarity]
test/pleroma/web/rich_media/parser/ttl/aws_signed_url_test.exs [moved from test/pleroma/web/rich_media/parsers/ttl/aws_signed_url_test.exs with 97% similarity]

similarity index 71%
rename from lib/pleroma/web/rich_media/parsers/ttl/ttl.ex
rename to lib/pleroma/web/rich_media/parser/ttl.ex
index 13511888c23b5f856030eb3f7fb69e3cac7909ff..8353f0fff0e28812f37b30b888365c3df5f739c7 100644 (file)
@@ -3,5 +3,5 @@
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.Web.RichMedia.Parser.TTL do
-  @callback ttl(Map.t(), String.t()) :: {:ok, Integer.t()} | {:error, String.t()}
+  @callback ttl(Map.t(), String.t()) :: Integer.t() | nil
 end
similarity index 96%
rename from lib/pleroma/web/rich_media/parsers/ttl/aws_signed_url.ex
rename to lib/pleroma/web/rich_media/parser/ttl/aws_signed_url.ex
index 15109d28de39022892917ab2b1eec44a53b578fb..fc4ef79c0c19ddac74a56e2cf93f7de154f3c2cb 100644 (file)
@@ -5,7 +5,7 @@
 defmodule Pleroma.Web.RichMedia.Parser.TTL.AwsSignedUrl do
   @behaviour Pleroma.Web.RichMedia.Parser.TTL
 
-  @impl Pleroma.Web.RichMedia.Parser.TTL
+  @impl true
   def ttl(data, _url) do
     image = Map.get(data, :image)
 
similarity index 97%
rename from test/pleroma/web/rich_media/parsers/ttl/aws_signed_url_test.exs
rename to test/pleroma/web/rich_media/parser/ttl/aws_signed_url_test.exs
index 4a3122638ad2faea1dceccd3a5fabad80ed9db65..2f17bebd7279d718f64195bdf720bf47f9ecb578 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Web.RichMedia.Parsers.TTL.AwsSignedUrlTest do
+defmodule Pleroma.Web.RichMedia.Parser.TTL.AwsSignedUrlTest do
   use ExUnit.Case, async: true
 
   test "s3 signed url is parsed correct for expiration time" do