Moved everything over to the new library scan - needs cleanup

This commit is contained in:
Remy
2011-08-15 19:54:11 -07:00
parent 22aef717d1
commit 4983852b07
8 changed files with 188 additions and 166 deletions

View File

@@ -85,6 +85,33 @@
%endfor
</tbody>
</table>
<%
unmatched = myDB.select('SELECT * from have WHERE ArtistName LIKE ? AND AlbumTitle LIKE ?', [album['ArtistName'], album['AlbumTitle']])
%>
%if unmatched:
<table class="display" id="track_table">
<thead>
<tr>
<th id="number">#</th>
<th id="name">Track Title</th>
<th id="duration">Duration</th>
<th id="location">Local File</th>
<th id="bitrate">Bit Rate</th>
</tr>
</thead>
<tbody>
%for track in unmatched:
<tr class="gradeZ">
<td id="number">${track['TrackNumber']}</td>
<td id="name">${track['TrackTitle']}</td>
<td id="duration">${track['TrackLength']}</td>
<td id="location">${track['Location']}</td>
<td id="bitrate">${track['BitRate']}</td>
</tr>
%endfor
</tbody>
</table>
%endif
</div>
</div>
</%def>

View File

@@ -41,11 +41,12 @@
<tr>
<th id="select"><input type="checkbox" onClick="toggle(this)" /></th>
<th id="albumart"></th>
<th id="albumname">Album Name</th>
<th id="reldate">Release Date</th>
<th id="type">Release Type</th>
<th id="albumname">Name</th>
<th id="reldate">Date</th>
<th id="type">Type</th>
<th id="status">Status</th>
<th id="have">Have</th>
<th id="bitrate">Bitrate</th>
</tr>
</thead>
<tbody>
@@ -62,7 +63,7 @@
myDB = db.DBConnection()
totaltracks = len(myDB.select('SELECT TrackTitle from tracks WHERE AlbumID=?', [album['AlbumID']]))
havetracks = len(myDB.select('SELECT TrackTitle from have WHERE ArtistName like ? AND AlbumTitle like ?', [album['ArtistName'], album['AlbumTitle']]))
havetracks = len(myDB.select('SELECT TrackTitle from tracks WHERE AlbumID=? AND Location IS NOT NULL', [album['AlbumID']]))
try:
percent = (havetracks*100.0)/totaltracks
@@ -71,6 +72,12 @@
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 = ''
%>
<tr class="grade${grade}">
@@ -89,6 +96,7 @@
%endif
</td>
<td id="have"><span title="${percent}"><span><div class="progress-container"><div style="width:${percent}%"><div class="havetracks">${havetracks}/${totaltracks}</div></div></div></td>
<td id="bitrate">${bitrate}</td>
</tr>
%endfor
</tbody>
@@ -114,7 +122,8 @@
null,
null,
null,
{ "sType": "title-numeric"}
{ "sType": "title-numeric"},
null
],
"oLanguage": {
"sLengthMenu":"Show _MENU_ albums per page",

View File

@@ -42,7 +42,7 @@
%>
<tr class="grade${grade}">
<td id="dateadded">${item['DateAdded']}</td>
<td id="filename"><a href="${item['URL']}">${item['Title']}</a></td>
<td id="filename"><a href="${item['URL']}">${item['Title']}</a> <a href="albumPage?AlbumID=?${item['AlbumID']}">[album page]</a></td>
<td id="size">${helpers.bytes_to_mb(item['Size'])}</td>
<td id="status">${item['Status']}</td>
<td id="action">[<a href="queueAlbum?AlbumID=${item['AlbumID']}&redirect=history">retry</a>][<a href="queueAlbum?AlbumID=${item['AlbumID']}&new=True&redirect=history">new</a>]</td>