~umgeher/utfs-core

bb51e449f2dbd03b7f36e17a6a7cffe4b8feccc5 — Umgeher Torgersen 11 months ago 1ddb865 0.2.0
adding _ as event prefix and setting SI
1 files changed, 6 insertions(+), 1 deletions(-)

M src/utfs_core_tl_set.erl
M src/utfs_core_tl_set.erl => src/utfs_core_tl_set.erl +6 -1
@@ 7,4 7,9 @@
set(Timeline, TS, Event) when is_binary(Timeline), is_integer(TS) ->
    {ok, UID} = utfs_core:tl_uid(Timeline),
    {ok, TSNow} = utos_datetime:timestamp_ms(),
    utfs_core:kv_set(UID, Event, Value).
    TLKey = erlang:integer_to_binary(TS),
    {ok, set} = utfs_core:kv_set(UID, <<"_e", TLKey/binary>>, #tl{e = Event, ts = TS, tsc = TSNow}),
    {ok, set} = utfs_core:si_set(UID, <<"_e", TLKey/binary>>, <<"e">>, <<"true">>),
    {ok, set} = utfs_core:si_set(UID, <<"_e", TLKey/binary>>, <<"ts">>, TS),
    {ok, set} = utfs_core:si_set(UID, <<"_e", TLKey/binary>>, <<"tsc">>, TSNow),
    {ok, <<"_e", TLKey/binary>>}.