%inherit file="base.html" />
<%!
from headphones import db, helpers
myDB = db.DBConnection()
%>
<%def name="headerIncludes()">
%def>
<%def name="body()">
Back to ${album['ArtistName']}
# |
Track Title |
Duration |
Local File |
Bit Rate |
Format |
%for track in tracks:
<%
if track['Location']:
grade = 'A'
location = track['Location']
else:
grade = 'X'
location = ''
if track['BitRate']:
bitrate = str(track['BitRate']/1000) + ' kbps'
else:
bitrate = ''
try:
trackduration = helpers.convert_milliseconds(track['TrackDuration'])
except:
trackduration = 'n/a'
%>
${track['TrackNumber']} |
${track['TrackTitle']} |
${trackduration} |
${location} |
${bitrate} |
${format} |
%endfor
<%
unmatched = myDB.select('SELECT * from have WHERE ArtistName LIKE ? AND AlbumTitle LIKE ?', [album['ArtistName'], album['AlbumTitle']])
%>
%if unmatched:
%for track in unmatched:
<%
duration = helpers.convert_seconds(float(track['TrackLength']))
%>
${track['TrackNumber']} |
${track['TrackTitle']} |
${duration} |
${track['Location']} |
${int(track['BitRate'])/1000} kbps |
${track['Format']} |
%endfor
%endif
%def>
<%def name="headIncludes()">
%def>
<%def name="javascriptIncludes()">
%def>