def tracks(self, album=None, artist=None): tracks = db.select_tracks(DBFILE, album, artist) track_list = [] for track in tracks: track_list.append({ 'path': track[0], 'title': track[1], 'track': track[2], 'duration': track[3], 'artist': track[4], 'album': track[5] }) return track_list
def index(self): tmpl = env.get_template('index.html') tracks = db.select_tracks(DBFILE) return tmpl.render()