aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/media.erl9
1 files changed, 1 insertions, 8 deletions
diff --git a/server/media.erl b/server/media.erl
index d20c8e9..f5f4770 100644
--- a/server/media.erl
+++ b/server/media.erl
@@ -91,14 +91,7 @@ play(Artist, Title, Callback) ->
[Head|_] = ask(Artist, Title),
{_, Title, Artist, _, _, Fp} = Head,
Port = erlang:open_port({spawn_executable, "/usr/bin/mplayer"}, [{args, [Fp]}, exit_status]),
-
- % lock the song
- F = fun() ->
- New = Head#track{locked = 1},
- mnesia:write(New)
- end,
- mnesia:transaction(F),
-
+ spawn(media, lock_process,[Artist,Title]),
io:format("playing: ~s, Artist: ~s~n", [Title, Artist]),
receive
{Port, {exit_status, 0}} -> start_playing();