2020-10-12 11:00:50 -06:00
|
|
|
# Pleroma: A lightweight social networking server
|
2021-01-12 23:49:20 -07:00
|
|
|
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
2020-10-12 11:00:50 -06:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2019-07-18 23:58:42 -06:00
|
|
|
defmodule Pleroma.Web.RichMedia.Parser.TTL do
|
2024-02-11 14:11:52 -07:00
|
|
|
@callback ttl(map(), String.t()) :: integer() | nil
|
|
|
|
|
|
|
|
def get_from_image(data, url) do
|
|
|
|
[:rich_media, :ttl_setters]
|
|
|
|
|> Pleroma.Config.get()
|
|
|
|
|> Enum.reduce({:ok, nil}, fn
|
|
|
|
module, {:ok, _ttl} ->
|
|
|
|
module.ttl(data, url)
|
|
|
|
|
|
|
|
_, error ->
|
|
|
|
error
|
|
|
|
end)
|
|
|
|
end
|
2019-07-18 23:58:42 -06:00
|
|
|
end
|