diff options
author | Marco Ziener <mziener@lavabit.com> | 2010-10-14 15:13:12 +0200 |
---|---|---|
committer | Marco Ziener <mziener@lavabit.com> | 2010-10-14 15:13:12 +0200 |
commit | 6fec8b2bbfbd5ff9e4bf031cc8f110af262fe8dd (patch) | |
tree | 860926a7b56fd0088a160b6fab4e82f127e07741 /server | |
parent | 2abd89ef6bab5474e80f4037dfa65a610aee111c (diff) | |
download | erlang-6fec8b2bbfbd5ff9e4bf031cc8f110af262fe8dd.tar.gz erlang-6fec8b2bbfbd5ff9e4bf031cc8f110af262fe8dd.tar.xz erlang-6fec8b2bbfbd5ff9e4bf031cc8f110af262fe8dd.zip |
Improvements
Diffstat (limited to 'server')
-rw-r--r-- | server/cldb.erl | 12 | ||||
-rw-r--r-- | server/media.erl | 4 |
2 files changed, 14 insertions, 2 deletions
diff --git a/server/cldb.erl b/server/cldb.erl new file mode 100644 index 0000000..23eecff --- /dev/null +++ b/server/cldb.erl @@ -0,0 +1,12 @@ +% The clientdatabase + +-module(cldb). +-export([init/0]). +-record(user, {name, passwd, votes}). + +init() -> + mnesia:create_schema[node()], + mnesia:start(), + mnesia:create_table(track, [{attributes, record_info(fields, track)}]), + io:format("Userdb up and running \n"). + diff --git a/server/media.erl b/server/media.erl index c732107..9b58067 100644 --- a/server/media.erl +++ b/server/media.erl @@ -43,7 +43,7 @@ read_files([],Total,Fail) -> io:format("Total: ~w, Failed: ~w~n", [Total, Fail]) start_playing() -> {Artist, Title} = search_best(media:all(), 0,0), - play(Artist, Title, "muh"). + play(Artist, Title). % Basic insertion of entrys into the database. Some entries are left out because they are 0 or false. @@ -87,7 +87,7 @@ all() -> % In practice we are going to set their locked variable to true and spawn a process which will unlock them after a certain time. % Well this could be considered abuse. -play(Artist, Title, Callback) -> +play(Artist, Title) -> [Head|_] = ask(Artist, Title), {_, Title, Artist, _, _, Fp} = Head, Port = erlang:open_port({spawn_executable, "/usr/bin/mplayer"}, [{args, [Fp]}, exit_status]), |