1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-08-13 16:53:54 -04:00

Revert "Fix color in displayShow when manually searching."

This commit is contained in:
Fernando 2015-02-21 00:20:33 -02:00
parent 7cfb777807
commit 32ab502be5
2 changed files with 25 additions and 29 deletions

View File

@ -45,9 +45,9 @@ function updateImages(data) {
if (el) { if (el) {
if (ep.searchstatus == 'searching') { if (ep.searchstatus == 'searching') {
//el=$('td#' + ep.season + 'x' + ep.episode + '.search img'); //el=$('td#' + ep.season + 'x' + ep.episode + '.search img');
img.prop('title','Searching'); img.attr('title','Searching');
img.prop('alt','Searching'); img.attr('alt','earching');
img.prop('src',sbRoot+'/images/' + loadingImage); img.attr('src',sbRoot+'/images/' + loadingImage);
disableLink(el); disableLink(el);
// Update Status and Quality // Update Status and Quality
var rSearchTerm = /(\w+)\s\((.+?)\)/; var rSearchTerm = /(\w+)\s\((.+?)\)/;
@ -56,24 +56,23 @@ function updateImages(data) {
} }
else if (ep.searchstatus == 'queued') { else if (ep.searchstatus == 'queued') {
//el=$('td#' + ep.season + 'x' + ep.episode + '.search img'); //el=$('td#' + ep.season + 'x' + ep.episode + '.search img');
img.prop('title','Queued'); img.attr('title','Queued');
img.prop('alt','queued'); img.attr('alt','queued');
img.prop('src',sbRoot+'/images/' + queuedImage ); img.attr('src',sbRoot+'/images/' + queuedImage );
disableLink(el); disableLink(el);
HtmlContent = ep.searchstatus; HtmlContent = ep.searchstatus;
} }
else if (ep.searchstatus == 'finished') { else if (ep.searchstatus == 'finished') {
//el=$('td#' + ep.season + 'x' + ep.episode + '.search img'); //el=$('td#' + ep.season + 'x' + ep.episode + '.search img');
img.prop('title','Searching'); img.attr('title','Searching');
img.prop('alt','searching'); img.attr('alt','searching');
img.parent().prop('class','epRetry'); img.parent().attr('class','epRetry');
img.prop('src',sbRoot+'/images/' + searchImage); img.attr('src',sbRoot+'/images/' + searchImage);
enableLink(el); enableLink(el);
// Update Status and Quality // Update Status and Quality
var rSearchTerm = /(\w+)\s\((.+?)\)/; var rSearchTerm = /(\w+)\s\((.+?)\)/;
HtmlContent = ep.status.replace(rSearchTerm,"$1"+' <span class="quality '+ep.quality+'">'+"$2"+'</span>'); HtmlContent = ep.status.replace(rSearchTerm,"$1"+' <span class="quality '+ep.quality+'">'+"$2"+'</span>');
parent.closest('tr').prop("class", ep.overview + " season-" + ep.season + " seasonstyle")
} }
// update the status column if it exists // update the status column if it exists
@ -92,13 +91,13 @@ $(document).ready(function () {
function enableLink(el) { function enableLink(el) {
el.on('click.disabled', false); el.on('click.disabled', false);
el.prop('enableClick', '1'); el.attr('enableClick', '1');
el.fadeTo("fast", 1) el.fadeTo("fast", 1)
} }
function disableLink(el) { function disableLink(el) {
el.off('click.disabled'); el.off('click.disabled');
el.prop('enableClick', '0'); el.attr('enableClick', '0');
el.fadeTo("fast", .5) el.fadeTo("fast", .5)
} }
@ -122,11 +121,11 @@ function disableLink(el) {
event.preventDefault(); event.preventDefault();
// Check if we have disabled the click // Check if we have disabled the click
if ( $(this).prop('enableClick') == '0' ) { if ( $(this).attr('enableClick') == '0' ) {
return false; return false;
} }
if ( $(this).prop('class') == "epRetry" ) { if ( $(this).attr('class') == "epRetry" ) {
if ( !confirm("Mark download as bad and retry?") ) if ( !confirm("Mark download as bad and retry?") )
return false; return false;
}; };
@ -138,12 +137,12 @@ function disableLink(el) {
// Create var for img under anchor and set options for the loading gif // Create var for img under anchor and set options for the loading gif
img=$(this).children('img'); img=$(this).children('img');
img.prop('title','loading'); img.attr('title','loading');
img.prop('alt',''); img.attr('alt','');
img.prop('src',sbRoot+'/images/' + options.loadingImage); img.attr('src',sbRoot+'/images/' + options.loadingImage);
$.getJSON($(this).prop('href'), function(data){ $.getJSON($(this).attr('href'), function(data){
// if they failed then just put the red X // if they failed then just put the red X
if (data.result == 'failure') { if (data.result == 'failure') {
@ -162,15 +161,15 @@ function disableLink(el) {
HtmlContent = data.result.replace(rSearchTerm,"$1"+' <span class="quality '+data.quality+'">'+"$2"+'</span>'); HtmlContent = data.result.replace(rSearchTerm,"$1"+' <span class="quality '+data.quality+'">'+"$2"+'</span>');
// update the status column if it exists // update the status column if it exists
parent.siblings('.col-status').html(HtmlContent) parent.siblings('.col-status').html(HtmlContent)
// Only if the queuing was successful, disable the onClick event of the loading image // Only if the queing was succesfull, disable the onClick event of the loading image
disableLink(link); disableLink(link);
} }
// put the corresponding image as the result of queuing of the manual search // put the corresponding image as the result of queuing of the manual search
img.prop('title',img_result); img.attr('title',img_result);
img.prop('alt',img_result); img.attr('alt',img_result);
img.prop('height', options.size); img.attr('height', options.size);
img.prop('src',sbRoot+"/images/"+img_name); img.attr('src',sbRoot+"/images/"+img_name);
}); });
// //

View File

@ -1824,7 +1824,6 @@ class Home(WebRoot):
def getManualSearchStatus(self, show=None, season=None): def getManualSearchStatus(self, show=None, season=None):
def getEpisodes(searchThread, searchstatus): def getEpisodes(searchThread, searchstatus):
results = [] results = []
showObj = sickbeard.helpers.findCertainShow(sickbeard.showList, int(show))
if isinstance(searchThread, sickbeard.search_queue.ManualSearchQueueItem): if isinstance(searchThread, sickbeard.search_queue.ManualSearchQueueItem):
results.append({'episode': searchThread.segment.episode, results.append({'episode': searchThread.segment.episode,
@ -1832,8 +1831,7 @@ class Home(WebRoot):
'season': searchThread.segment.season, 'season': searchThread.segment.season,
'searchstatus': searchstatus, 'searchstatus': searchstatus,
'status': statusStrings[searchThread.segment.status], 'status': statusStrings[searchThread.segment.status],
'quality': self.getQualityClass(searchThread.segment), 'quality': self.getQualityClass(searchThread.segment)})
'overview': Overview.overviewStrings[showObj.getOverview(int(searchThread.segment.status or -1))]})
else: else:
for epObj in searchThread.segment: for epObj in searchThread.segment:
results.append({'episode': epObj.episode, results.append({'episode': epObj.episode,
@ -1841,8 +1839,7 @@ class Home(WebRoot):
'season': epObj.season, 'season': epObj.season,
'searchstatus': searchstatus, 'searchstatus': searchstatus,
'status': statusStrings[epObj.status], 'status': statusStrings[epObj.status],
'quality': self.getQualityClass(epObj), 'quality': self.getQualityClass(epObj)})
'overview': Overview.overviewStrings[showObj.getOverview(int(epObj.status or -1))]})
return results return results