Ensured thumbnail is converted to jpg before embedding
This commit is contained in:
parent
8f9d18dc71
commit
b5fcb4a97f
2 changed files with 9 additions and 1 deletions
|
|
@ -66,7 +66,7 @@ defmodule Pinchflat.Downloading.DownloadOptionBuilder do
|
||||||
acc ++ [:write_thumbnail, convert_thumbnail: "jpg"]
|
acc ++ [:write_thumbnail, convert_thumbnail: "jpg"]
|
||||||
|
|
||||||
{:embed_thumbnail, true} ->
|
{:embed_thumbnail, true} ->
|
||||||
acc ++ [:embed_thumbnail]
|
acc ++ [:embed_thumbnail, convert_thumbnail: "jpg"]
|
||||||
|
|
||||||
_ ->
|
_ ->
|
||||||
acc
|
acc
|
||||||
|
|
|
||||||
|
|
@ -141,6 +141,14 @@ defmodule Pinchflat.Downloading.DownloadOptionBuilderTest do
|
||||||
assert :embed_thumbnail in res
|
assert :embed_thumbnail in res
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "convertes thumbnail to jpg when embed_thumbnail is true", %{media_item: media_item} do
|
||||||
|
media_item = update_media_profile_attribute(media_item, %{embed_thumbnail: true})
|
||||||
|
|
||||||
|
assert {:ok, res} = DownloadOptionBuilder.build(media_item)
|
||||||
|
|
||||||
|
assert {:convert_thumbnail, "jpg"} in res
|
||||||
|
end
|
||||||
|
|
||||||
test "doesn't include these options when not specified", %{media_item: media_item} do
|
test "doesn't include these options when not specified", %{media_item: media_item} do
|
||||||
media_item = update_media_profile_attribute(media_item, %{embed_thumbnail: false, download_thumbnail: false})
|
media_item = update_media_profile_attribute(media_item, %{embed_thumbnail: false, download_thumbnail: false})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue