Update to database code

and tracking last played and incrementing play count.