From b23e1274bc8cc02d5c2bcabec1ce141e093f8225 Mon Sep 17 00:00:00 2001 From: Remy Date: Sat, 6 Aug 2011 22:40:31 -0700 Subject: [PATCH] Multiple album markings, select all javascript, better pp log message when unable to tag --- data/css/data_table.css | 2 -- data/css/style.css | 9 +++++---- data/interfaces/default/artist.html | 23 +++++++++++++++-------- data/interfaces/default/base.html | 10 +--------- data/interfaces/default/logs.html | 2 -- data/js/plugins.js | 2 +- headphones/postprocessor.py | 2 +- headphones/webserve.py | 18 ++++++++++++++++++ 8 files changed, 41 insertions(+), 27 deletions(-) diff --git a/data/css/data_table.css b/data/css/data_table.css index 86161738..5846855c 100644 --- a/data/css/data_table.css +++ b/data/css/data_table.css @@ -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 { diff --git a/data/css/style.css b/data/css/style.css index a5288327..caeeb30a 100755 --- a/data/css/style.css +++ b/data/css/style.css @@ -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; } diff --git a/data/interfaces/default/artist.html b/data/interfaces/default/artist.html index c299677a..0c02e83c 100644 --- a/data/interfaces/default/artist.html +++ b/data/interfaces/default/artist.html @@ -20,13 +20,21 @@ <%def name="body()">
- ${artist['ArtistName']} +

${artist['ArtistName']}

-
+ +

Mark selected albums as + + +

- + @@ -61,7 +69,7 @@ %> - @@ -72,6 +80,7 @@ %endfor
Album Name Release Date
+ ${album['AlbumTitle']} ${album['ReleaseDate']}
+
<%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']] }); diff --git a/data/interfaces/default/base.html b/data/interfaces/default/base.html index 10c0491a..f3a38847 100755 --- a/data/interfaces/default/base.html +++ b/data/interfaces/default/base.html @@ -27,15 +27,7 @@
- % if not headphones.CURRENT_VERSION: -
- You're running an unknown version of Headphones. Click here to update -
- % elif headphones.CURRENT_VERSION != headphones.LATEST_VERSION and headphones.INSTALL_TYPE != 'win': -
- A newer version is available. You're ${headphones.COMMITS_BEHIND} commits behind. Click here to update -
- % endif + diff --git a/data/interfaces/default/logs.html b/data/interfaces/default/logs.html index a4a146a6..d9aad901 100644 --- a/data/interfaces/default/logs.html +++ b/data/interfaces/default/logs.html @@ -9,7 +9,6 @@ Timestamp Level - Thread Message @@ -28,7 +27,6 @@ ${out_tuple[0]} ${out_tuple[1]} - ${out_tuple[2]} ${out_tuple[3].decode('utf-8')} %endif diff --git a/data/js/plugins.js b/data/js/plugins.js index bafe8161..da9863aa 100755 --- a/data/js/plugins.js +++ b/data/js/plugins.js @@ -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; } \ No newline at end of file diff --git a/headphones/postprocessor.py b/headphones/postprocessor.py index e97d46b1..68966f63 100644 --- a/headphones/postprocessor.py +++ b/headphones/postprocessor.py @@ -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] diff --git a/headphones/webserve.py b/headphones/webserve.py index 8e3359e2..768d9fd1 100644 --- a/headphones/webserve.py +++ b/headphones/webserve.py @@ -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...")