Added librarysync, added bitrate and location to db and album template

This commit is contained in:
Remy
2011-08-15 02:32:32 -07:00
parent 98427c23ff
commit 22aef717d1
6 changed files with 231 additions and 25 deletions
+5 -3
View File
@@ -173,17 +173,19 @@ table#album_table td#have { vertical-align: middle; }
img.albumArt { float: left; padding-right: 5px; }
div#albumheader { padding-top: 48px; height: 200px; }
div#track_wrapper { padding-top: 20px; text-align: center; font-size: 16px; }
div#track_wrapper { margin-left: -50px; padding-top: 20px; font-size: 16px; width: 100%; }
table#track_table th#number { text-align: right; min-width: 20px; }
table#track_table th#name { text-align: center; min-width: 350px; }
table#track_table th#duration { width: 175px; text-align: center; min-width: 100px; }
table#track_table th#have { width: 175px; text-align: center; min-width: 100px; }
table#track_table th#location { text-align: center; min-width: 200px; }
table#track_table th#bitrate { text-align: center; min-width: 75px; }
table#track_table td#number { vertical-align: middle; text-align: right; }
table#track_table td#name { vertical-align: middle; text-align: center; }
table#track_table td#duration { vertical-align: middle; text-align: center; }
table#track_table td#have { vertical-align: middle; text-align: center; }
table#track_table td#location { vertical-align: middle; text-align: center; font-size: 11px; }
table#track_table td#location { vertical-align: middle; text-align: center; }
table#history_table { background-color: white; width: 100%; }
+12 -7
View File
@@ -51,20 +51,24 @@
<th id="number">#</th>
<th id="name">Track Title</th>
<th id="duration">Duration</th>
<th id="location"></th>
<th id="location">Local File</th>
<th id="bitrate">Bit Rate</th>
</tr>
</thead>
<tbody>
<%
i = 0
%>
%for track in tracks:
<%
i += 1
if track['Location']:
grade = 'A'
location = track['Location']
else:
grade = 'Z'
location = ''
if track['BitRate']:
bitrate = str(track['BitRate']/1000) + ' kbps'
else:
bitrate = ''
try:
trackduration = helpers.convert_milliseconds(track['TrackDuration'])
@@ -72,10 +76,11 @@
trackduration = 'n/a'
%>
<tr class="grade${grade}">
<td id="number">${i}</td>
<td id="number">${track['TrackNumber']}</td>
<td id="name">${track['TrackTitle']}</td>
<td id="duration">${trackduration}</td>
<td id="location">${track['Location']}</td>
<td id="location">${location}</td>
<td id="bitrate">${bitrate}</td>
</tr>
%endfor
</tbody>
+14 -11
View File
@@ -51,33 +51,36 @@
<th id="number">#</th>
<th id="name">Track Title</th>
<th id="duration">Duration</th>
<th id="have"></th>
<th id="location">Local File</th>
<th id="bitrate">Bit Rate</th>
</tr>
</thead>
<tbody>
<%
i = 0
%>
%for track in tracks:
<%
i += 1
have = myDB.select('SELECT TrackTitle from have WHERE ArtistName like ? AND AlbumTitle like ? AND TrackTitle like ?', [track['ArtistName'], track['AlbumTitle'], track['TrackTitle']])
if len(have):
if track['Location']:
grade = 'A'
check = '<img src="images/checkmark.png" alt="checkmark">'
location = track['Location']
else:
grade = 'Z'
check = ''
location = ''
if track['BitRate']:
bitrate = str(track['BitRate']/1000) + ' kbps'
else:
bitrate = ''
try:
trackduration = helpers.convert_milliseconds(track['TrackDuration'])
except:
trackduration = 'n/a'
%>
<tr class="grade${grade}">
<td id="number">${i}</td>
<td id="number">${track['TrackNumber']}</td>
<td id="name">${track['TrackTitle']}</td>
<td id="duration">${trackduration}</td>
<td id="have">${check}</td>
<td id="location">${location}</td>
<td id="bitrate">${bitrate}</td>
</tr>
%endfor
</tbody>