         location: file
      switch type
         when 'audio'
-            parser = new mmd stream = fs.createReadStream file
-            parser.on 'metadata', (data) ->
-                media.creator = data.artist?[0] or 'Unknown'
+            parseTags file, (data) ->
+                media.creator = media.artist = data.artist?[0] or 'Unknown'
                 media.title = data.title or 'Untitled'
                 media.album = data.album or 'Untitled'
+                media.genre = data.genre?[0] if data.genre?[0]?
+                media.track = data.track?.no if data.track?.no > 0
+                media.date = data.year if data.year > 0
                 callback null, media
-            parser.on 'done', (err) ->
-                console.error(err) if err?
-                stream.destroy()
         else
             media.creator = 'Unknown'
             media.title = path.basename file, path.extname file


addContainer = (parentId, dir, callback) ->
    fs.readdir dir, (err, files) ->
        sortFiles dir, files, (err, sortedFiles) ->
            makeContainer dir, sortedFiles, (err, container) ->
                mediaServer.addMedia parentId, container, (err, id) ->

        location: dir
    
    if contentType is 'audio'
        parseTags sortedFiles[contentType][0], (data) ->
            media.creator = media.artist =
                if data.albumartist.length > 0
                    data.albumartist[0]
                else if data.artist.length > 0
                    data.artist
                else
                    'Unknown'
            media.title = data.album or path.basename(dir).split('/')[0]
            callback null, media
    else
        media.creator = 'Unknown'
        media.title = path.basename(dir).split('/')[0]
