1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-14 12:02:21 -05:00
SickRage/gui/slick/js/manageEpisodeStatuses.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

67 lines
2.2 KiB
JavaScript

$(document).ready(function() {
function make_row(indexer_id, season, episode, name, checked) {
if (checked)
var checked = ' checked';
else
var checked = '';
var row_class = $('#row_class').val();
var row = '';
row += ' <tr class="'+row_class+'">';
row += ' <td><input type="checkbox" class="'+indexer_id+'-epcheck" name="'+indexer_id+'-'+season+'x'+episode+'"'+checked+'></td>';
row += ' <td>'+season+'x'+episode+'</td>';
row += ' <td style="width: 100%">'+name+'</td>';
row += ' </tr>'
return row;
}
$('.allCheck').click(function(){
var indexer_id = $(this).attr('id').split('-')[1];
$('.'+indexer_id+'-epcheck').prop('checked', $(this).prop('checked'));
});
$('.get_more_eps').click(function(){
var cur_indexer_id = $(this).attr('id');
var checked = $('#allCheck-'+cur_indexer_id).prop('checked');
var last_row = $('tr#'+cur_indexer_id);
$.getJSON(sbRoot+'/manage/showEpisodeStatuses',
{
indexer_id: cur_indexer_id,
whichStatus: $('#oldStatus').val()
},
function (data) {
$.each(data, function(season,eps){
$.each(eps, function(episode, name) {
//alert(season+'x'+episode+': '+name);
last_row.after(make_row(cur_indexer_id, season, episode, name, checked));
});
});
});
$(this).hide();
});
// selects all visible episode checkboxes.
$('.selectAllShows').click(function(){
$('.allCheck').each(function(){
this.checked = true;
});
$('input[class*="-epcheck"]').each(function(){
this.checked = true;
});
});
// clears all visible episode checkboxes and the season selectors
$('.unselectAllShows').click(function(){
$('.allCheck').each(function(){
this.checked = false;
});
$('input[class*="-epcheck"]').each(function(){
this.checked = false;
});
});
});