diff options
Diffstat (limited to 'lib/lsg_irc/last_fm_handler.ex')
-rw-r--r-- | lib/lsg_irc/last_fm_handler.ex | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/lsg_irc/last_fm_handler.ex b/lib/lsg_irc/last_fm_handler.ex index fe767b1..4eef24e 100644 --- a/lib/lsg_irc/last_fm_handler.ex +++ b/lib/lsg_irc/last_fm_handler.ex @@ -64,6 +64,14 @@ defmodule LSG.IRC.LastFmHandler do {:noreply, state} end + def terminate(_reason, state) do + if state.dets do + :dets.sync(state.dets) + :dets.close(state.dets) + end + :ok + end + defp irc_now_playing(nick_or_user, chan, state) do nick_or_user = String.strip(nick_or_user) username = case :dets.lookup(state.dets, String.downcase(nick_or_user)) do |