           media.genre = data.genre if data.genre?
           media.track = data.track if data.track?
           media.date = data.year if data.year?
-          media.contenttype = mime.lookup file
+          media.contenttype = 'audio/mpeg'
           fs.stat file, (err, stats) ->
             media.filesize = stats?.size or 0
             cb null, media

"use strict"

async = require 'async'
fs = require 'fs'
mime = require 'mime'
mmd = require 'musicmetadata'

require('zappa') port, ->
  @get '/res/:id': ->
    db.hget @params.id, 'path', (err, path) =>
      # Transcode to mp3 using ffmpeg
      @response.contentType 'mp3'
      prov = new ffmpeg(path)
        .withAudioCodec('libmp3lame')
        .toFormat('mp3')
        .writeToStream @response, (ret, err) ->
          console.log err if err?
