var fs = require('fs');
var join = require('path').join;
var getShiny = function (name) {
  name = name.charAt(0).toUpperCase() + name.substring(1).toLowerCase();
  name = name.replace('.mp3', '');
  name = name.replace(/-/g, ' ');
  return name;
};
var getUnShiny = function (name) {
  name = name.toLowerCase();
  name = name.replace(/ /g, '-');
  name = name.replace(/_/g, '-');
  return name;
};
module.exports = function (root) {
  var result = [];
  var queue = ['/'];
  while (queue.length) {
    var d = queue.shift();
    fs.readdirSync(join(root, d)).sort().forEach(function (entry) {
      var f = join(root, d, entry);
      var stat = fs.statSync(f);
      if (stat.isDirectory() && entry != 'node_modules') {
        queue.push(join(d, entry));
      } else {
        if (/.mp3/.test(entry)) {
          var filename = getUnShiny(entry);
          fs.renameSync(f, join(root, d, filename));
          result.push({
            uri: d + '/' + filename,
            name: getShiny(entry)
          });
        }
      }
    });
  }
  return result;
};
@@ -428,16 +428,29 @@
 root) %7B%0A
+  var id = 0%0A
   var re
@@ -925,22 +925,212 @@
     
-result.push(%7B%0A
+if (d == '/') %7B%0A            result.push(%7B%0A                uri: d + filename,%0A                name: getShiny(entry),%0A                id: id%0A            %7D);%0A          %7D else %7B%0A            result.push(%7B%0A    
     
@@ -1154,32 +1154,36 @@
 '/' + filename,%0A
+    
             name
@@ -1199,16 +1199,17 @@
 y(entry)
+,
 %0A       
@@ -1203,34 +1203,87 @@
 try),%0A          
-%7D)
+      id: id%0A            %7D);%0A          %7D%0A          id++
 ;%0A        %7D%0A    

Fix uri bug of root musics