1
0
mirror of https://github.com/algora-io/tv.git synced 2024-11-26 01:00:20 +02:00

generate stream thumbnail inside a supervised task

This commit is contained in:
zafer 2024-05-09 16:29:57 +03:00
parent 9f1e201125
commit e9ce649ad9

View File

@ -69,15 +69,17 @@ defmodule Algora.Storage do
%{type: :segment, mode: :binary},
%{video: %{thumbnail_url: nil} = video, video_header: video_header} = state
) do
Task.Supervisor.start_child(Algora.TaskSupervisor, fn ->
case Library.store_thumbnail(video, video_header <> contents) do
{:ok, video} ->
broadcast_thumbnails_generated!(video)
{:ok, %{state | video_segment: contents, video: video}}
_ ->
Membrane.Logger.error("Could not generate thumbnails for video #{video.id}")
{:ok, %{state | video_segment: contents}}
end
end)
{:ok, %{state | video_segment: contents}}
end
defp process_contents(