From 103f3dcb9ed0a12a11e9cc5c574449439fc2cb0e Mon Sep 17 00:00:00 2001 From: Alexander Strizhakov Date: Tue, 23 Jun 2020 18:33:03 +0300 Subject: [PATCH] rich media parser ttl files consistency --- lib/pleroma/web/rich_media/{parsers/ttl => parser}/ttl.ex | 2 +- .../web/rich_media/{parsers => parser}/ttl/aws_signed_url.ex | 2 +- .../rich_media/{parsers => parser}/ttl/aws_signed_url_test.exs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename lib/pleroma/web/rich_media/{parsers/ttl => parser}/ttl.ex (71%) rename lib/pleroma/web/rich_media/{parsers => parser}/ttl/aws_signed_url.ex (96%) rename test/pleroma/web/rich_media/{parsers => parser}/ttl/aws_signed_url_test.exs (97%) diff --git a/lib/pleroma/web/rich_media/parsers/ttl/ttl.ex b/lib/pleroma/web/rich_media/parser/ttl.ex 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 13511888c..8353f0fff 100644 --- a/lib/pleroma/web/rich_media/parsers/ttl/ttl.ex +++ b/lib/pleroma/web/rich_media/parser/ttl.ex @@ -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 diff --git a/lib/pleroma/web/rich_media/parsers/ttl/aws_signed_url.ex b/lib/pleroma/web/rich_media/parser/ttl/aws_signed_url.ex 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 15109d28d..fc4ef79c0 100644 --- a/lib/pleroma/web/rich_media/parsers/ttl/aws_signed_url.ex +++ b/lib/pleroma/web/rich_media/parser/ttl/aws_signed_url.ex @@ -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) diff --git a/test/pleroma/web/rich_media/parsers/ttl/aws_signed_url_test.exs b/test/pleroma/web/rich_media/parser/ttl/aws_signed_url_test.exs 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 4a3122638..2f17bebd7 100644 --- a/test/pleroma/web/rich_media/parsers/ttl/aws_signed_url_test.exs +++ b/test/pleroma/web/rich_media/parser/ttl/aws_signed_url_test.exs @@ -2,7 +2,7 @@ # Copyright © 2017-2020 Pleroma Authors # 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 -- 2.45.2