Multiple album markings, select all javascript, better pp log message when unable to tag

This commit is contained in:
Remy
2011-08-06 22:40:31 -07:00
parent 38e9af762b
commit b23e1274bc
8 changed files with 41 additions and 27 deletions

View File

@@ -166,12 +166,10 @@ table.display td.center {
*/
table.display tr.odd.gradeA {
background-color: #ddffdd;
font-weight: bold;
}
table.display tr.even.gradeA {
background-color: #ddffdd;
font-weight: bold;
}
table.display tr.odd.gradeC {

View File

@@ -110,6 +110,8 @@ h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p.indented { 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; }
@@ -144,13 +146,13 @@ table#artist_table td#have { vertical-align: middle; }
div#paddingheader { padding-top: 48px; font-size: 24px; font-weight: bold; text-align: center; }
table#album_table { background-color: white; }
table#album_table th#checkbox { text-align: left; min-width: 25px; }
table#album_table th#select { text-align: left; min-width: 25px; }
table#album_table th#albumart { text-align: left; min-width: 50px; }
table#album_table th#albumname { text-align: center; min-width: 150px; }
table#album_table th#reldate { width: 175px; text-align: center; min-width: 100px; }
table#album_table th#status { width: 175px; text-align: center; min-width: 100px; }
table#album_table th#type { width: 175px; text-align: center; min-width: 100px; }
table#album_table td#checkbox { vertical-align: middle; text-align: left; }
table#album_table td#select { vertical-align: middle; text-align: left; }
table#album_table td#albumart { vertical-align: middle; text-align: left; }
table#album_table td#albumname { vertical-align: middle; text-align: center; }
table#album_table td#reldate { vertical-align: middle; text-align: center; }
@@ -176,9 +178,8 @@ table#history_table { background-color: white; width: 100%; }
table#log_table { background-color: white; }
table#log_table th#timestamp { text-align: left; min-width: 200px; }
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#thread { text-align: left; min-width: 75px; }
table#log_table th#message { text-align: left; min-width: 200px; }
div.progress-container { border: 1px solid #ccc; width: 100px; height: 14px; margin: 2px 5px 2px 0; padding: 1px; float: left; background: white; }

View File

@@ -20,13 +20,21 @@
<%def name="body()">
<div id="paddingheader">
${artist['ArtistName']}
<h1>${artist['ArtistName']}<h1>
</div>
<form action="markAlbums" method="post">
<form action="markAlbums" method="get"><input type="hidden" name="ArtistID" value=${artist['ArtistID']}>
<p class="indented">Mark selected albums as
<select name="action">
<option value="Wanted">Wanted</option>
<option value="Skipped">Skipped</option>
<option value="Downloaded">Downloaded</option>
</select>
<input type="submit" value="Go">
</p>
<table class="display" id="album_table">
<thead>
<tr>
<th class="checkbox"><input type="checkbox" onClick="toggle(this)" /></th>
<th class="select"><input type="checkbox" onClick="toggle(this)" /></th>
<th id="albumart"></th>
<th id="albumname">Album Name</th>
<th id="reldate">Release Date</th>
@@ -61,7 +69,7 @@
%>
<tr class="grade${grade}">
<td id="checkbox"><input type="checkbox" name="mbid" value="${album['AlbumID']}" /></th>
<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="albumname"><a href="albumPage?AlbumID=${album['AlbumID']}">${album['AlbumTitle']}</a></td>
<td id="reldate">${album['ReleaseDate']}</td>
@@ -72,6 +80,7 @@
%endfor
</tbody>
</table>
</form>
</%def>
<%def name="headIncludes()">
@@ -97,12 +106,10 @@
"oLanguage": {
"sLengthMenu":"Show _MENU_ albums per page",
"sEmptyTable": "No album information available",
"sInfo":"Showing _START_ to _END_ of _TOTAL_ albums",
"sInfo":"Showing _TOTAL_ albums",
"sInfoEmpty":"Showing 0 to 0 of 0 albums",
"sInfoFiltered":"(filtered from _MAX_ total albums)"},
"bStateSave": true,
"iDisplayLength": 25,
"sPaginationType": "full_numbers",
"bPaginate": false,
"aaSorting": [[3, 'asc'],[2,'desc']]
});

View File

@@ -27,15 +27,7 @@
<body>
<div id="container">
<header>
% if not headphones.CURRENT_VERSION:
<div id="updatebar">
You're running an unknown version of Headphones. <a class="blue" href="update">Click here to update</a>
</div>
% elif headphones.CURRENT_VERSION != headphones.LATEST_VERSION and headphones.INSTALL_TYPE != 'win':
<div id="updatebar">
A <a class="blue" href="http://github.com/rembo10/headphones/compare/${headphones.CURRENT_VERSION}...${headphones.LATEST_VERSION}"> newer version</a> is available. You're ${headphones.COMMITS_BEHIND} commits behind. <a class="blue" href="update">Click here to update</a>
</div>
% endif
<div id="logo">
<img src="images/headphoneslogo.png" alt="headphones">
</div>

View File

@@ -9,7 +9,6 @@
<tr>
<th id="timestamp">Timestamp</th>
<th id="level">Level</th>
<th id="thread">Thread</th>
<th id="message">Message</th>
</tr>
</thead>
@@ -28,7 +27,6 @@
<tr class="grade${grade}">
<td id="timestamp">${out_tuple[0]}</td>
<td id="level">${out_tuple[1]}</td>
<td id="thread">${out_tuple[2]}</td>
<td id="message">${out_tuple[3].decode('utf-8')}</td>
</tr>
%endif

View File

@@ -35,7 +35,7 @@ jQuery.fn.dataTableExt.oSort['title-numeric-desc'] = function(a,b) {
};
function toggle(source) {
checkboxes = document.getElementsByName('mbid');
checkboxes = document.getElementsByClassName('checkbox');
for(var i in checkboxes)
checkboxes[i].checked = source.checked;
}

View File

@@ -330,7 +330,7 @@ def correctMetadata(albumid, release, downloaded_track_list):
cur_artist, cur_album, out_tuples, rec = autotag.tag_album(items, search_artist=release['ArtistName'], search_album=release['AlbumTitle'])
if rec == 'RECOMMEND_NONE':
logger.warn('No accurate match found - not writing metadata')
logger.warn('No accurate album match found for %s, %s - not writing metadata' % (release['ArtistName'], release['AlbumTitle']))
return
distance, items, info = out_tuples[0]

View File

@@ -162,6 +162,24 @@ class WebInterface(object):
deleteArtist.exposed = True
def refreshArtist(self, ArtistID):
import importer
importer.addArtisttoDB(artistid)
refreshArtist.exposed=True
def markAlbums(self, ArtistID=None, action=None, **args):
myDB = db.DBConnection()
for mbid in args:
controlValueDict = {'AlbumID': mbid}
newValueDict = {'Status': action}
myDB.upsert("albums", newValueDict, controlValueDict)
if action == 'Wanted':
import searcher
searcher.searchNZB(mbid, new=False)
raise cherrypy.HTTPRedirect("artistPage?ArtistID=%s" % ArtistID)
markAlbums.exposed = True
def queueAlbum(self, AlbumID, ArtistID, new=False):
logger.info(u"Marking album: " + AlbumID + "as wanted...")