<%inherit file="base.html"/> <%! from headphones import db import headphones import string %> <%def name="body()">
${artist['ArtistName']}
%if artist['Status'] == 'Loading':

Loading albums informations...

%else:

${artist['ArtistName']}

%endif

Mark as:

Click CTRL + LMOUSE on albums to select them in grid view.
%for album in albums: <% %>
%if album['Status'] == 'Skipped': %elif album['Status'] == 'Wanted': %else: * J %endif
${artist['ArtistName']} ${album['AlbumTitle']}
%endfor
%for album in albums: <% if album['Status'] == 'Skipped': grade = 'Z' elif album['Status'] == 'Wanted': grade = 'X' elif album['Status'] == 'Snatched': grade = 'C' else: grade = 'A' myDB = db.DBConnection() totaltracks = len(myDB.select('SELECT TrackTitle from tracks WHERE AlbumID=?', [album['AlbumID']])) havetracks = len(myDB.select('SELECT TrackTitle from tracks WHERE AlbumID=? AND Location IS NOT NULL', [album['AlbumID']])) + len(myDB.select('SELECT TrackTitle from have WHERE ArtistName like ? AND AlbumTitle LIKE ?', [album['ArtistName'], album['AlbumTitle']])) try: percent = (havetracks*100.0)/totaltracks if percent > 100: percent = 100 except (ZeroDivisionError, TypeError): percent = 0 totaltracks = '?' avgbitrate = myDB.action("SELECT AVG(BitRate) FROM tracks WHERE AlbumID=?", [album['AlbumID']]).fetchone()[0] if avgbitrate: bitrate = str(int(avgbitrate)/1000) + ' kbps' else: bitrate = '' %> %endfor
Name Date Type Have Bitrate
${album['AlbumTitle']} ${album['ReleaseDate']} ${album['Type']}
${percent}
${bitrate}
<%def name="headIncludes()"> %if artist['Status'] == 'Loading': %endif <%def name="javascriptIncludes()">