lib/player.js
function sortTracks(tracks) {
  var lib = new MusicLibraryIndex();
  tracks.forEach(function(track) {
    lib.addTrack(track);
  });
  lib.rebuildTracks();
  var results = [];
  lib.artistList.forEach(function(artist) {
    artist.albumList.forEach(function(album) {
      album.trackList.forEach(function(track) {
        results.push(track);
      });
    });
  });
  return results;
}
function sortTracks(tracks) {
  var lib = new MusicLibraryIndex();
  tracks.forEach(function(track) {
    lib.addTrack(track);
  });
  lib.rebuildTracks();
  var results = [];
  lib.artistList.forEach(function(artist) {
    artist.albumList.forEach(function(album) {
      album.trackList.forEach(function(track) {
        results.push(track);
      });
    });
  });
  return results;
}
function sortTracks ( tracks ) { var lib = new MusicLibraryIndex ( ) ; tracks . forEach ( function ( track ) { lib . addTrack ( track ) ; } ) ; lib . rebuildTracks ( ) ; var results = [ ] ; lib . artistList . forEach ( function ( artist ) { artist . albumList . forEach ( function ( album ) { album . trackList . forEach ( function ( track ) { results . push ( track ) ; } ) ; } ) ; } ) ; return results ; }
sort keys according to how they appear in the library
sort keys according to how they appear in the library