1
0
mirror of https://github.com/algora-io/tv.git synced 2025-03-27 20:20:18 +02:00

don't break stream if thumbnail generation fails

This commit is contained in:
zafer 2024-04-01 18:58:28 +03:00
parent 2b73c40bc5
commit d44c9a1009

View File

@ -68,9 +68,14 @@ defmodule Algora.Storage do
%{type: :segment, mode: :binary},
%{video: %{thumbnail_url: nil} = video, video_header: video_header} = state
) do
with {:ok, video} <- Library.store_thumbnail(video, video_header <> contents) do
broadcast_thumbnails_generated!(video)
{:ok, %{state | video: video}}
case Library.store_thumbnail(video, video_header <> contents) do
{:ok, video} ->
broadcast_thumbnails_generated!(video)
{:ok, %{state | video: video}}
_ ->
Membrane.Logger.error("Could not generate thumbnails for video #{video.id}")
{:ok, state}
end
end