From 67a116d9abd3382b584059e1cedab4523aba7952 Mon Sep 17 00:00:00 2001 From: Jakub Pryc <94321002+Noarkhh@users.noreply.github.com> Date: Thu, 5 Sep 2024 11:56:55 +0200 Subject: [PATCH] Fix genserver storage implenentation bad return (#107) --- .../storages/genserver_storage.ex | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/membrane_http_adaptive_stream/storages/genserver_storage.ex b/lib/membrane_http_adaptive_stream/storages/genserver_storage.ex index daf1fdc..39cf1b0 100644 --- a/lib/membrane_http_adaptive_stream/storages/genserver_storage.ex +++ b/lib/membrane_http_adaptive_stream/storages/genserver_storage.ex @@ -40,10 +40,7 @@ defmodule Membrane.HTTPAdaptiveStream.Storages.GenServerStorage do end @impl true - def store(parent_id, name, contents, metadata, context, %__MODULE__{ - destination: destination, - method: method - }) do + def store(parent_id, name, contents, metadata, context, impl_state) do params = Map.merge(context, %{ parent_id: parent_id, @@ -52,12 +49,12 @@ defmodule Membrane.HTTPAdaptiveStream.Storages.GenServerStorage do metadata: metadata }) - method.(destination, {__MODULE__, :store, params}) + {impl_state.method.(impl_state.destination, {__MODULE__, :store, params}), impl_state} end @impl true - def remove(parent_id, name, context, %__MODULE__{destination: destination, method: method}) do + def remove(parent_id, name, context, impl_state) do params = Map.merge(context, %{parent_id: parent_id, name: name}) - method.(destination, {__MODULE__, :remove, params}) + {impl_state.method.(impl_state.destination, {__MODULE__, :store, params}), impl_state} end end