Added descriptions from last fm, formatted album page, added retry buttons

This commit is contained in:
Remy
2011-08-07 21:18:42 -07:00
parent 6c235732e2
commit 45563c821c
15 changed files with 306 additions and 92 deletions
+32 -7
View File
@@ -102,15 +102,15 @@ a.blue {
container { }
body { background-color: #EBF4FB; min-width: 907px; }
body { background-color: #EBF4FB; min-width: 930px; }
header { min-height: 68px; width: 100%; min-width: 907px; padding-left: 0px; padding-right: 10px; background-color: #CDC9C9; position: fixed; z-index: 998; }
header { min-height: 68px; width: 100%; min-width: 930px; padding-left: 0px; padding-right: 10px; background-color: #CDC9C9; position: fixed; z-index: 998; }
h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p.indented { margin-left: 20px; font-size: 14px; }
p.indented { padding-top: 20px; margin-left: 20px; font-size: 14px; }
div#updatebar { text-align: center; min-width: 970px; width: 100%; background-color: light-blue; float: left; }
div#logo { float: left; padding-left: 10px; }
@@ -120,7 +120,7 @@ ul#nav li { margin: 40px 0px auto 10px; display: inline; }
ul#nav li a { padding: 5px; font-size: 16px; font-weight: bold; color: #330000; text-decoration: none; }
ul#nav li a:hover { background-color: #a3e532; }
div#subhead_container { height: 30px; width:100%; min-width: 907px; background-color:#330000; float: left; list-style-type: none; z-index: 998; overflow: hidden; }
div#subhead_container { height: 30px; width:100%; min-width: 930px; background-color:#330000; float: left; list-style-type: none; z-index: 998; overflow: hidden; }
ul#subhead_menu { margin-top: 5px; }
ul#subhead_menu li { width: 100%; height: 100%; display: inline; }
ul#subhead_menu li a { padding: 5px 15px 10px 15px; vertical-align: middle; color: white; font-size: 16px; text-decoration: none; }
@@ -131,6 +131,9 @@ div#searchbar { margin: 24px 30px auto auto; float: right; }
div#main { margin: 0; padding: 80px 0 0 0; }
.table_wrapper { border-radius: 20px; -webkit-border-radius: 20px; -moz-border-radius: 20px; width: 88%; margin: 20px auto 0 auto; padding: 25px; background-color: white; position: relative; min-height: 200px; clear: both; _height: 302px; zoom: 1; }
.manage_wrapper { width: 88%; margin: 20px auto 0 auto; padding: 25px; min-height: 150px; clear: both; _height: 302px; zoom: 1; }
.table_wrapper_left { padding: 25px; background-color: #ffffff; float: left; width: 40%; height: 200px; margin-top: 25px; margin-left: 30px; margin-right: auto; -moz-border-radius: 20px; border-radius: 20px; }
.table_wrapper_right{ padding: 25px; background-color: #ffffff; width: 40%; height: 200px; margin-top: 25px; margin-left: auto; margin-right: 30px; -moz-border-radius: 20px; border-radius: 20px; }
table#artist_table { background-color: white; width: 100%; padding: 20px; }
@@ -144,6 +147,7 @@ table#artist_table td#album { vertical-align: middle; text-align: left; min-widt
table#artist_table td#have { vertical-align: middle; }
div#paddingheader { padding-top: 48px; font-size: 24px; font-weight: bold; text-align: center; }
div#nopaddingheader { font-size: 24px; font-weight: bold; text-align: center; }
table#album_table { background-color: white; }
table#album_table th#select { vertical-align: middle; text-align: left; min-width: 25px; }
@@ -161,15 +165,15 @@ table#album_table td#type { vertical-align: middle; text-align: center; }
table#album_table td#have { vertical-align: middle; }
img.albumArt { float: left; padding-right: 5px; }
div#albumheader { height: 200px; }
div#albumheader { padding-top: 48px; height: 200px; }
div#track_wrapper { padding-top: 20px; text-align: center; font-size: 16px; }
table#track_table th#number { text-align: left; min-width: 50px; }
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 td#number { vertical-align: middle; text-align: left; }
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; }
@@ -182,6 +186,27 @@ table#log_table th#timestamp { text-align: left; min-width: 165px; }
table#log_table th#level { text-align: left; min-width: 75px; }
table#log_table th#message { text-align: left; min-width: 200px; }
table#upcoming_table th#albumart { text-align: center; min-width: 50px; }
table#upcoming_table th#albumname { text-align: center; min-width: 200px; }
table#upcoming_table th#artistname { text-align: center; min-width: 150px; }
table#upcoming_table th#reldate { text-align: center; min-width: 100px; }
table#upcoming_table th#type { text-align: center; min-width: 75px; }
table#upcoming_table td#albumart { vertical-align: middle; text-align: center; min-width: 50px; }
table#upcoming_table td#albumname { vertical-align: middle; text-align: center; min-width: 200px; }
table#upcoming_table td#artistname { vertical-align: middle; text-align: center; min-width: 150px; }
table#upcoming_table td#reldate { vertical-align: middle; text-align: center; min-width: 100px; }
table#upcoming_table td#type { vertical-align: middle; text-align: center; min-width: 75px; }
table#upcoming_table td#status { vertical-align: middle; text-align: center; }
table#searchresults_table th#albumname { text-align: left; min-width: 225px; }
table#searchresults_table th#artistname { text-align: center; min-width: 325px; }
table#searchresults_table th#score { text-align: center; min-width: 75px; }
table#searchresults_table td#albumname { vertical-align: middle; text-align: left; min-width: 200px; }
table#searchresults_table td#artistname { vertical-align: middle; text-align: left; min-width: 300px; }
table#searchresults_table td#score { vertical-align: middle; text-align: center; min-width: 75px; }
div.progress-container { border: 1px solid #ccc; width: 100px; height: 14px; margin: 2px 5px 2px 0; padding: 1px; float: left; background: white; }
div.progress-container > div { background-color: #a3e532; height: 14px; }
.havetracks { font-size: 13px; margin-left: 36px; padding-bottom: 3px; vertical-align: middle; }
+26 -12
View File
@@ -7,26 +7,36 @@
<%def name="headerIncludes()">
<div id="subhead_container">
<ul id="subhead_menu">
<li><a href="refreshArtist?ArtistID=${album['ArtistID']}">Mark Album as Wanted</a></li>
<li><a href="deleteArtist?ArtistID=${album['ArtistID']}">Delete Artist</a></li>
%if album['Status'] == 'Paused':
<li><a href="resumeArtist?ArtistID=${album['ArtistID']}">Resume Artist</a></li>
%if album['Status'] == 'Skipped':
<li><a href="queueAlbum?AlbumID=${album['AlbumID']}&ArtistID=${album['ArtistID']}&new=False">Mark Album as Wanted</a></li>
%elif album['Status'] == 'Snatched' or 'Downloaded':
<li><a href="queueAlbum?AlbumID=${album['AlbumID']}&ArtistID=${album['ArtistID']}&new=False">Retry Download</a></li>
<li><a href="queueAlbum?AlbumID=${album['AlbumID']}&ArtistID=${album['ArtistID']}&new=True">Try New Version</a></li>
%else:
<li><a href="pauseArtist?ArtistID=${album['ArtistID']}">Pause Artist</a></li>
%endif
<li><a href="getExtras?ArtistID=${album['ArtistID']}">Get Extras</a></li>
<li><a href="unqueueAlbum?AlbumID=${album['AlbumID']}&ArtistID=${album['ArtistID']}&new=False">Mark Album as Skipped</a></li>
%endif
</ul>
</div>
</%def>
<%def name="body()">
<div class="table_wrapper">
<h2><a href="artistPage?ArtistID=${album['ArtistID']}"><- Back to ${album['ArtistName']}</a></h2>
<div id="albumheader">
<img src="http://ec1.images-amazon.com/images/P/${album['AlbumASIN']}.01.LZZZZZZZ.jpg" height="200" width="200" alt="albumart" class="albumArt">
<h1>${album['AlbumTitle']}</h1>
<h2>${album['ArtistName']}</h2>
<br>
<%
totalduration = myDB.action("SELECT SUM(TrackDuration) FROM tracks WHERE AlbumID=?", [album['AlbumID']]).fetchone()[0]
totaltracks = len(myDB.select("SELECT TrackTitle from tracks WHERE AlbumID=?", [album['AlbumID']]))
%>
<h3>Tracks: ${totaltracks}</h3>
<h3>Duration: ${helpers.convert_milliseconds(totalduration)}</h3>
%if description:
<h3>Description: </h3>
${description['Summary']}
%endif
</div>
<div id="track_wrapper">
<table class="display" id="track_table">
@@ -35,14 +45,18 @@
<th id="number">#</th>
<th id="name">Track Title</th>
<th id="duration">Duration</th>
<th id="have">Have</th>
<th id="have"></th>
</tr>
</thead>
<tbody>
<%
i = 0
%>
%for track in tracks:
<%
trackmatch = 'asd'
if len(trackmatch):
i += 1
have = myDB.select('SELECT TrackTitle from have WHERE ArtistName like ? AND AlbumTitle like ? AND TrackTitle like ?', [album['ArtistName'], album['AlbumTitle'], track['TrackTitle']])
if len(have):
grade = 'A'
check = '<img src="images/checkmark.png" alt="checkmark">'
else:
@@ -50,9 +64,9 @@
check = ''
%>
<tr class="grade${grade}">
<td id="number">#</td>
<td id="number">${i}</td>
<td id="name">${track['TrackTitle']}</td>
<td id="duration">${track['TrackDuration']}</td>
<td id="duration">${helpers.convert_milliseconds(track['TrackDuration'])}</td>
<td id="have">${check}</td>
</tr>
%endfor
+11 -2
View File
@@ -26,6 +26,7 @@
<p class="indented">Mark selected albums as
<select name="action">
<option value="Wanted">Wanted</option>
<option value="WantedNew">Wanted (new only)</option>
<option value="Skipped">Skipped</option>
<option value="Downloaded">Downloaded</option>
</select>
@@ -74,7 +75,15 @@
<td id="albumname"><a href="albumPage?AlbumID=${album['AlbumID']}">${album['AlbumTitle']}</a></td>
<td id="reldate">${album['ReleaseDate']}</td>
<td id="type">${album['Type']}</td>
<td id="status">${album['Status']}</td>
<td id="status">${album['Status']}
%if album['Status'] == 'Skipped':
[<a href="queueAlbum?AlbumID=${album['AlbumID']}&ArtistID=${album['ArtistID']}">want</a>]
%elif album['Status'] == 'Wanted':
[<a href="unqueueAlbum?AlbumID=${album['AlbumID']}&ArtistID=${album['ArtistID']}">skip</a>]
%else:
[<a href="queueAlbum?AlbumID=${album['AlbumID']}&ArtistID=${album['ArtistID']}" title="Retry the same download again">retry</a>][<a href="queueAlbum?AlbumID=${album['AlbumID']}&ArtistID=${album['ArtistID']}&new=True" title="Try a new download, skipping all previously tried nzbs">new</a>]
%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>
</tr>
%endfor
@@ -110,7 +119,7 @@
"sInfoEmpty":"Showing 0 to 0 of 0 albums",
"sInfoFiltered":"(filtered from _MAX_ total albums)"},
"bPaginate": false,
"aaSorting": [[3, 'asc'],[2,'desc']]
"aaSorting": [[4, 'asc'],[3,'desc']]
});
});
+1 -1
View File
@@ -49,7 +49,7 @@
<li><a href="config">settings</a></li>
</ul>
<div id="searchbar">
<form action="findArtist" method="get">
<form action="search" method="get">
<input type="text" value="" onfocus="if(this.value==this.defaultValue) this.value='';" name="name" />
<select name="type">
<option value="artist">Artist</option>
+1 -1
View File
@@ -1,5 +1,6 @@
<%inherit file="base.html"/>
<form action="configUpdate" method="post">
<div id="config">
<div class="table_wrapper">
<h1>Web Interface</h1>
<table>
@@ -216,5 +217,4 @@
</p>
</form>
</div>
</div>
<%inherit file="base.html" />
+6 -1
View File
@@ -1,4 +1,7 @@
<%inherit file="base.html"/>
<%!
from headphones import helpers
%>
<%def name="headerIncludes()">
<div id="subhead_container">
@@ -22,6 +25,7 @@
<th id="filename">File Name</th>
<th id="size">Size</th>
<th id="status">Status</th>
<th id="action"></th>
</tr>
</thead>
<tbody>
@@ -39,8 +43,9 @@
<tr class="grade${grade}">
<td id="dateadded">${item['DateAdded']}</td>
<td id="filename"><a href="${item['URL']}">${item['Title']}</a></td>
<td id="size">${item['Size']}</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>
</tr>
%endfor
</tbody>
+31 -7
View File
@@ -1,4 +1,8 @@
<%inherit file="base.html" />
<%!
import headphones
%>
<%def name="body()">
<div class="table_wrapper">
<h1>Scan Music Library</h1><br />
@@ -10,24 +14,44 @@
as soon as you click 'Submit'
<br /><br />
<form action="musicScan" method="GET" align="center">
%if headphones.MUSIC_DIR:
<input type="text" value="${headphones.MUSIC_DIR}" name="path" size="70" />
%else:
<input type="text" value="Enter a Music Directory to scan" onfocus="if
(this.value==this.defaultValue) this.value='';" name="path" size="70" />
%endif
<input type="submit" /></form>
</div>
<div class="table_wrapper">
<div class="table_wrapper_left">
<h1>Import Last.FM Artists</h1><br />
Enter the username whose artists you want to import:<br /><br />
<form action="importLastFM" method="GET" align="center">
<input type="text" value="%s" onfocus="if
<%
if headphones.LASTFM_USERNAME:
lastfmvalue = headphones.LASTFM_USERNAME
else:
lastfmvalue = 'Last.fm Username'
%>
<input type="text" value="${lastfmvalue}" onfocus="if
(this.value==this.defaultValue) this.value='';" name="username" size="18" />
<input type="submit" /></form><br /><br /></div></div>
<div class="tableright"><div class="config"><h1>Placeholder :-)</h1><br />
<input type="submit" /></form><br /><br />
</div>
<div class="table_wrapper_right">
<h1>Placeholder :-)</h1><br />
<br /><br />
<form action="" method="GET" align="center">
<input type="text" value="" onfocus="if
(this.value==this.defaultValue) this.value='';" name="" size="18" />
<input type="submit" /></form><br /><br /></div></div><br />
<div class="table"><div class="config"><h1>Force Search</h1><br />
<input type="submit" /></form><br /><br />
</div>
<div class="table_wrapper">
<h1>Force Search</h1><br />
<a href="forceSearch">Force Check for Wanted Albums</a><br /><br />
<a href="forceUpdate">Force Update Active Artists</a><br /><br />
<a href="forcePostProcess">Force Post-Process Albums in Download Folder</a><br /><br /><br />
<a href="checkGithub">Check for Headphones Updates</a><br /><br /><br /></div></div>''' % (music_dir_input, lastfm_user_text))
<a href="checkGithub">Check for Headphones Updates</a><br /><br /><br />
</div>
</%def>
@@ -0,0 +1,70 @@
<%inherit file="base.html" />
<%def name="body()">
<div id="paddingheader">
<h1>Search Results<h1>
</div>
<table class="display" id="searchresults_table">
<thead>
<tr>
%if type == 'album':
<th id="albumname">Album Name</th>
%endif
<th id="artistname">Artist Name</th>
<th id="score">Score</th>
<th id="add"></th>
</tr>
</thead>
<tbody>
%if searchresults:
%for result in searchresults:
<%
if result['score'] == 100:
grade = 'A'
else:
grade = 'Z'
%>
<tr class="grade${grade}">
%if type == 'album':
<td id="albumname"><a href="${result['albumurl']}">${result['title']}</a></td>
%endif
<td id="artistname"><a href="${result['url']}">${result['uniquename']}</a></td>
<td id="score">${result['score']}</td>
%if type == 'album':
<td id="add"><a href="addReleaseById?rid=${result['albumid']}">Add this album</a></td>
%else:
<td id="add"><a href="addArtist?artistid=${result['id']}">Add this artist</a></td>
%endif
</tr>
%endfor
%endif
</tbody>
</table>
</%def>
<%def name="headIncludes()">
<link rel="stylesheet" href="css/data_table.css">
</%def>
<%def name="javascriptIncludes()">
<script src="js/libs/jquery.dataTables.min.js"></script>
<script>
$(document).ready(function()
{
$('#searchresults_table').dataTable(
{
"oLanguage": {
"sLengthMenu":"Show _MENU_ results per page",
"sEmptyTable": "No results",
"sInfo":"Showing _TOTAL_ results",
"sInfoEmpty":"Showing 0 to 0 of 0 results",
"sInfoFiltered":"(filtered from _MAX_ total results)"},
"bPaginate": false,
"bFilter": false,
"aaSorting": []
});
});
</script>
</%def>
+1 -1
View File
@@ -6,6 +6,6 @@
<%def name="body()">
<div class="table_wrapper">
Headphones is ${message}
<h1>Headphones is ${message}</h1>
</div>
</%def>
+13 -5
View File
@@ -9,7 +9,7 @@
<th id="artistname">Artist</th>
<th id="albumname">Album Name</th>
<th id="reldate">Release Date</th>
<th id="type">Release Type</th>
<th id="type">Type</th>
<th id="status">Status</th>
</tr>
</thead>
@@ -26,30 +26,38 @@
%endfor
</tbody>
</table>
</div>
<form action="markAlbums" method="get">
<p class="indented">Mark selected albums as
<select name="action">
<option value="Skipped">Skipped</option>
<option value="Downloaded">Downloaded</option>
</select>
<input type="submit" value="Go">
</p>
<div class="table_wrapper">
<h1>Wanted Albums</h1>
<table class="display" id="upcoming_table">
<thead>
<tr>
<th id="select"><input type="checkbox" onClick="toggle(this)" /></th>
<th id="albumart"></th>
<th id="artistname">Artist</th>
<th id="albumname">Album Name</th>
<th id="reldate">Release Date</th>
<th id="type">Release Type</th>
<th id="status">Status</th>
<th id="type">Type</th>
</tr>
</thead>
<tbody>
%for album in wanted:
<tr class="gradeZ">
<td id="select"><input type="checkbox" name="${album['AlbumID']}" class="checkbox" /></th>
<td id="albumart"><img src="http://ec1.images-amazon.com/images/P/${album['AlbumASIN']}.01.MZZZZZZZ.jpg" height="50" width="50"></td>
<td id="artistname">${album['ArtistName']}</td>
<td id="albumname"><a href="albumPage?AlbumID=${album['AlbumID']}">${album['AlbumTitle']}</a></td>
<td id="reldate">${album['ReleaseDate']}</td>
<td id="type">${album['Type']}</td>
<td id="status">${album['Status']}</td>
</tr>
%endfor
</tbody>