Skip to content

Commit

Permalink
use album information only when present for scoring
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelcorso committed Nov 22, 2009
1 parent 994836b commit 23abcc0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/playdar_utils.erl
Expand Up @@ -42,7 +42,13 @@ calc_score({ArtClean, Art}, {TrkClean, Trk}, {AlbClean, Alb}) ->
TrkScore = 1-math:cos(TrkScore0*math:pi()/2),
AlbScore = 1-math:cos(AlbScore0*math:pi()/2),
% combine them, weighting artist more than track:
Score0 = (ArtScore + TrkScore + AlbScore)/3.0,
case string:equal(Alb, "") of
false ->
Score0 = (ArtScore + TrkScore + AlbScore)/3.0;
true ->
Score0 = (ArtScore + TrkScore)/2.0
end,

Score = case Score0 > 0.99 of
true -> 1.0;
false -> Score0
Expand Down

0 comments on commit 23abcc0

Please sign in to comment.