aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Ziener <mziener@lavabit.com>2010-10-14 15:21:25 +0200
committerMarco Ziener <mziener@lavabit.com>2010-10-14 15:21:25 +0200
commitee91bed1f6d4eb661628811b786c3b7ad2ff11cd (patch)
treebe7f01a42491784a1dd6d0fa20d9e1651eb9233c
parent6fec8b2bbfbd5ff9e4bf031cc8f110af262fe8dd (diff)
downloaderlang-ee91bed1f6d4eb661628811b786c3b7ad2ff11cd.tar.gz
erlang-ee91bed1f6d4eb661628811b786c3b7ad2ff11cd.tar.xz
erlang-ee91bed1f6d4eb661628811b786c3b7ad2ff11cd.zip
Fixed errors
-rw-r--r--server/media.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/media.erl b/server/media.erl
index 9b58067..7c08caa 100644
--- a/server/media.erl
+++ b/server/media.erl
@@ -135,7 +135,7 @@ reset_votes(Artist, Title) ->
lock(Artist, Title) ->
F = fun() ->
[Head|_] = ask(Artist, Title),
- Votes = Head#track.votes - 1,
+ Votes = Head#track.lock = true,
New = Head#track{votes = Votes},
mnesia:write(New)
end,
@@ -144,7 +144,7 @@ lock(Artist, Title) ->
unlock(Artist, Title) ->
F = fun() ->
[Head|_] = ask(Artist, Title),
- Votes = Head#track.votes -1,
+ Votes = Head#track.lock = false,
New = Head#track{votes = Votes},
mnesia:write(New)
end,