aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2010-10-14 13:49:14 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2010-10-14 13:49:14 +0200
commit7b0bf7c8b3e57bbeadfb8e23ebe43696acf0bfe0 (patch)
tree6bd82bccffff6b3d1905a73c7b369893b3e05054 /server
parent204e06b2af3f8d4f41298967aa1ce4b9e0838227 (diff)
downloaderlang-7b0bf7c8b3e57bbeadfb8e23ebe43696acf0bfe0.tar.gz
erlang-7b0bf7c8b3e57bbeadfb8e23ebe43696acf0bfe0.tar.xz
erlang-7b0bf7c8b3e57bbeadfb8e23ebe43696acf0bfe0.zip
removed trailing whitespaces
Diffstat (limited to 'server')
-rw-r--r--server/media.erl7
1 files changed, 3 insertions, 4 deletions
diff --git a/server/media.erl b/server/media.erl
index fd4a1b6..0a99275 100644
--- a/server/media.erl
+++ b/server/media.erl
@@ -29,11 +29,11 @@ init() ->
io:format("Initialisation of mnesia successful.\n"),
start_playing().
-read_files([FN|Rest],Total,Fail) ->
+read_files([FN|Rest],Total,Fail) ->
case id3v2:read_file(FN) of
{ok, Props} -> % insert entry into mnesia DB
Artist = proplists:get_value(tpe1, Props),
- Title = proplists:get_value(tit2, Props),
+ Title = proplists:get_value(tit2, Props),
insert(bitstring_to_list(Artist), bitstring_to_list(Title), FN),
read_files(Rest, Total+1, Fail);
not_found -> read_files(Rest, Total+1, Fail+1)
@@ -49,7 +49,6 @@ start_playing() ->
insert(Artist, Title, Filepath) ->
F = fun() ->
-
mnesia:write(#track{artist = Artist, title = Title, votes = 0, locked = false, filepath = Filepath})
end,
mnesia:transaction(F).
@@ -90,7 +89,7 @@ play(Artist, Title, Callback) ->
% Of course we need a query to find out whats actually the most wished for track.
% We will do it by requesting all the records from the database and then iteramte over just taking a look at the vote
-% variable, so it is like list of integers. In case no tracks were voted for we just take the first track we find and play it. Of course it is locked afterwards so another will be choosen.
+% variable, so it is like list of integers. In case no tracks were voted for we just take the first track we find and play it. Of course it is locked afterwards so another will be choosen.
vote(Artist, Title) ->
F = fun() ->