Don't keep retrying CCA image

This commit is contained in:
Bas Stottelaar
2014-09-17 01:47:32 +02:00
parent 5eef5a594c
commit d04dff9130

View File

@@ -38,7 +38,7 @@
%>
<tr class="grade${grade}">
%if type == 'album':
<td id="albumart" style=" text-align: center; vertical-align: middle;"><div id="artistImg"><img title="${result['albumid']}" class="albumArt" height="50" width="50" onerror="this.src='${caa_group_url}'"></div></td>
<td id="albumart" style=" text-align: center; vertical-align: middle;"><div id="artistImg"><img title="${result['albumid']}" class="albumArt" height="50" width="50" onerror="tryCCA('${caa_group_url}')"></div></td>
%else:
<td id="albumart"><div id="artistImg"><img title="${result['id']}" class="albumArt" height="50" width="50"></div></td>
%endif
@@ -72,12 +72,22 @@
<script src="js/libs/jquery.dataTables.min.js"></script>
<script type="text/javascript">
function tryCCA(url) {
var image = $(this);
if (!image.hasClass('done')) {
image.addClass('done');
image.onerror = null;
this.src = url;
}
}
function getArt() {
$("table#searchresults_table tr td#albumart img").each(function(){
var id = $(this).attr('title');
var image = $(this);
if ( !image.hasClass('done') ) {
if (!image.hasClass('done')) {
image.addClass('done');
getImageLinks(image, id, "${type}", true);
}