Skip to content

Commit

Permalink
findbest
Browse files Browse the repository at this point in the history
  • Loading branch information
albertz committed May 22, 2016
1 parent 8a6d7a5 commit 6053406
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/findbest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

import songdb

def search(s):
songs = songdb.search(s)
songs = [s for s in songs if s.get("rating",0) > 0]
songs.sort(lambda s1,s2: s1.get("rating") > s2.get("rating"))
return ["%s - %s" % (s["artist"], s["title"]) for s in songs]

0 comments on commit 6053406

Please sign in to comment.