From 69c37e13acd820ef48f949afc795bf01d3690ae1 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Wed, 13 Oct 2010 10:51:46 +0200 Subject: code cleanup --- media.erl | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'media.erl') diff --git a/media.erl b/media.erl index 13e84c3..a761f64 100644 --- a/media.erl +++ b/media.erl @@ -25,7 +25,7 @@ init() -> mnesia:start(), mnesia:create_table(track, [{attributes, record_info(fields, track)}]), io:format("Initialisation of mnesia successful.\n"). - + % Basic insertion of entrys into the database. Some entries are left out because they are 0 or false. insert(Artist, Title, Filepath) -> @@ -36,14 +36,11 @@ insert(Artist, Title, Filepath) -> % We want to query in order to simplify the next calls. ask(Artist, Title) -> - F = fun() -> - mnesia:match_object({track, Artist, Title, '_', '_', '_'}) - end, - {atomic, Results} = mnesia:transaction(F), + F = fun() -> + mnesia:match_object({track, Artist, Title, '_', '_', '_'}) + end, + {atomic, Results} = mnesia:transaction(F), Results. % We want to play mp3s from our database. play(Artist, Title) -> io:format("blub"). - - - -- cgit v1.2.3