 
 
 jsonToSong = (json_data) ->
-  song = new SongDisplay [], {}
+  song = new SongDisplay [], "", {}
   for key, value in JSON.parse json_data
     song[key] = value
   return song


UNKNOWN_STRING = "UNKNOWN"

class SongDisplay
  constructor: (@directories, fileObject) ->
    # This data can be shared with datatables.
    @data = [
      fileObject.index,
      fileObject.title or UNKNOWN_STRING,
      fileObject.album or UNKNOWN_STRING,
      fileObject.artist or UNKNOWN_STRING]
    @filename = fileObject.filename


songIndex = (song) ->
  return song.data[0]

      progressCallback = ->
        progressElement.val (100 * fileId / data.files.length).toFixed(0)
    filesDisplay = []

    fields = {}
    for fieldKey, index in data.fields
      fields[fieldKey] = index

    for fileinfo, index in data.files
      fileId++
      if fileId % FILE_PROGRESS_UPDATE_INTERVAL == 0
        progressCallback()

      filesDisplay.push createSong fields, index, directoriesDisplay, fileinfo

    progressCallback()
    createPlayerElements filesDisplay
