SickGear/gui/slick/js/addShowOptions.js
JackDandy fae9ae6bb7 Change terminology around the custom quality selection to improve clarity.
Change restrict changing custom download qualities to reasonable selections.
Add upgrade to quality selections on Add show page and Import existing show page.
2018-02-03 22:41:52 +00:00

40 lines
1.3 KiB
JavaScript

$(document).ready(function(){
$('#saveDefaultsButton').click(function() {
var anyQualArray = [], bestQualArray = [];
$('#wanted-qualities option:selected').each(function(i, d) {
anyQualArray.push($(d).val());
});
$('#upgrade-qualities option:selected').each(function(i, d) {
bestQualArray.push($(d).val());
});
$.get(sbRoot + '/config/general/saveAddShowDefaults', {
default_status: $('#statusSelect').val(),
any_qualities: anyQualArray.join(','),
best_qualities: bestQualArray.join(','),
default_wanted_begin: $('#wanted_begin').val(),
default_wanted_latest: $('#wanted_latest').val(),
default_flatten_folders: $('#flatten_folders').prop('checked'),
default_scene: $('#scene').prop('checked'),
default_subtitles: $('#subtitles').prop('checked'),
default_anime: $('#anime').prop('checked'),
default_tag: $('#tag').val()
});
new PNotify({
title: 'Saving Defaults',
text: 'Saving your "add show" defaults.',
shadow: false
});
$(this).attr('disabled', true);
});
$('#statusSelect, #quality-preset, #wanted-qualities, #upgrade-qualities, #wanted_begin, #wanted_latest,'
+ ' #flatten_folders, #scene, #subtitles, #anime, #tag').change(function() {
$('#saveDefaultsButton').attr('disabled', false);
});
});