diff options
author | Michael Wittig <michael.wittig@fu-berlin.de> | 2010-10-14 15:03:36 +0200 |
---|---|---|
committer | Michael Wittig <michael.wittig@fu-berlin.de> | 2010-10-14 15:03:36 +0200 |
commit | 2abd89ef6bab5474e80f4037dfa65a610aee111c (patch) | |
tree | 0ce10ef03d5345e83cf36817a955121b12ab3f82 /server | |
parent | f274c57728163f77abf3b2afb18ffe6041b6720f (diff) | |
download | erlang-2abd89ef6bab5474e80f4037dfa65a610aee111c.tar.gz erlang-2abd89ef6bab5474e80f4037dfa65a610aee111c.tar.xz erlang-2abd89ef6bab5474e80f4037dfa65a610aee111c.zip |
ehm ka
Diffstat (limited to 'server')
-rw-r--r-- | server/media.erl | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/server/media.erl b/server/media.erl index b3b8e0f..c732107 100644 --- a/server/media.erl +++ b/server/media.erl @@ -91,14 +91,9 @@ 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), - + reset_votes(Artist, Title), + lock_process(Artist, Title), + io:format("playing: ~s, Artist: ~s~n", [Title, Artist]), receive {Port, {exit_status, 0}} -> start_playing(); |