1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-11-15 22:05:02 -05:00
SickRage/gui/slick/js/ajaxEpRetry.js
echel0n 0d9fbc1ad7 Welcome to our SickBeard-TVRage Edition ...
This version of SickBeard uses both TVDB and TVRage to search and gather it's series data from allowing you to now have access to and download shows that you couldn't before because of being locked into only what TheTVDB had to offer.

Also this edition is based off the code we used in our XEM editon so it does come with scene numbering support as well as all the other features our XEM edition has to offer.

Please before using this with your existing database (sickbeard.db) please make a backup copy of it and delete any other database files such as cache.db and failed.db if present, we HIGHLY recommend starting out with no database files at all to make this a fresh start but the choice is at your own risk!

Enjoy!
2014-03-09 22:39:12 -07:00

52 lines
1.9 KiB
JavaScript

(function () {
$.ajaxEpRetry = {
defaults: {
size: 16,
colorRow: false,
loadingImage: 'loading16_dddddd.gif',
noImage: 'no16.png',
yesImage: 'yes16.png'
}
};
$.fn.ajaxEpRetry = function (options) {
options = $.extend({}, $.ajaxEpRetry.defaults, options);
$('.epRetry').click(function () {
if ( !confirm("Mark download as bad and retry?") )
return false;
var parent = $(this).parent();
// put the ajax spinner (for non white bg) placeholder while we wait
parent.empty();
parent.append($("<img/>").attr({"src": sbRoot + "/images/" + options.loadingImage, "height": options.size, "alt": "", "title": "loading"}));
$.getJSON($(this).attr('href'), function (data) {
// if they failed then just put the red X
if (data.result == 'failure') {
img_name = options.noImage;
img_result = 'failed';
// if the snatch was successful then apply the corresponding class and fill in the row appropriately
} else {
img_name = options.yesImage;
img_result = 'success';
// color the row
if (options.colorRow) {
parent.parent().removeClass('skipped wanted qual good unaired snatched').addClass('snatched');
}
}
// put the corresponding image as the result for the the row
parent.empty();
parent.append($("<img/>").attr({"src": sbRoot + "/images/" + img_name, "height": options.size, "alt": img_result, "title": img_result}));
});
// don't follow the link
return false;
});
};
})();