diff options
author | href <href@random.sh> | 2021-09-08 15:58:34 +0200 |
---|---|---|
committer | href <href@random.sh> | 2021-09-08 15:58:34 +0200 |
commit | e5f3327afc6699e1f3d5a5a674f8b4421ff2443f (patch) | |
tree | 528c34515b2e12524b667e4b666c39d6f2af1331 /lib/lsg_irc/alcolog_plugin.ex | |
parent | ;o custom subnets (diff) |
various fixes
Diffstat (limited to 'lib/lsg_irc/alcolog_plugin.ex')
-rw-r--r-- | lib/lsg_irc/alcolog_plugin.ex | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/lsg_irc/alcolog_plugin.ex b/lib/lsg_irc/alcolog_plugin.ex index 8a7bcb9..46c43f4 100644 --- a/lib/lsg_irc/alcolog_plugin.ex +++ b/lib/lsg_irc/alcolog_plugin.ex @@ -66,6 +66,16 @@ defmodule LSG.IRC.AlcoologPlugin do {:ok, meta} = :dets.open_file(dets_meta_filename, [{:type,:set}]) traverse_fun = fn(obj, dets) -> case obj do + object = {nick, naive = %NaiveDateTime{}, volumes, active, cl, deg, name, comment} -> + date = naive + |> DateTime.from_naive!("Etc/UTC") + |> DateTime.to_unix() + new = {nick, date, volumes, active, cl, deg, name, comment, Map.new()} + :dets.delete_object(dets, object) + :dets.insert(dets, new) + :ets.insert(ets, {{nick, date}, volumes, active, cl, deg, name, comment, Map.new()}) + dets + object = {nick, naive = %NaiveDateTime{}, volumes, active, cl, deg, name, comment, meta} -> date = naive |> DateTime.from_naive!("Etc/UTC") |