Handlebars.registerHelper('trackname', function() { var item = this; if(!item.metadata) return item.name; if(item.metadata.title) return item.metadata.title; else return item.name; }); var templates = new (function Templates() { this.directory_item = Handlebars.compile('{{trackname}}{{metadata.artist}}{{metadata.album}}'); // The playlist automatically adds a tr tag. this.playlist_item = Handlebars.compile('{{trackname}}{{metadata.artist}}{{metadata.album}}Delete'); this.albums_item = Handlebars.compile('
{{name}} by {{artist.name}}
{{name}}
'); this.album_tab = Handlebars.compile('
Loading...
'); this.album_tabli = Handlebars.compile('
  • Album: {{album.name}} Remove tab
  • '); })();