Add validation when using Release Group token on page config Post Processing/Episode Naming/Name pattern/Custom.

This commit is contained in:
JackDandy 2015-03-12 17:57:04 +00:00
parent f63ee33610
commit 9747778e28
3 changed files with 29 additions and 4 deletions

View file

@ -31,6 +31,7 @@
* Change naming of SEARCHQUEUE threads for shorter log lines
* Fix Recent Search running status on Manage Searches page
* Change to no longer require restart with the "Scan and post process" option on page config/Post Processing
* Add validation when using Release Group token on page config Post Processing/Episode Naming/Name pattern/Custom
[develop changelog]
* Fix traceback error when using the menu item Manage/Update Kodi

View file

@ -442,7 +442,7 @@
</tr>
<tr>
<td class="align-right"><i class="icon-info-sign" title="'SickGear' is used in place of RLSGROUP if it could not be properly detected"></i> <b>Release Group:</b></td>
<td>%RG</td>
<td>-%RG</td>
<td>RLSGROUP</td>
</tr>
<tr class="even">
@ -667,7 +667,7 @@
</tr>
<tr class="even">
<td class="align-right"><i class="icon-info-sign" title="if RLSGROUP is not detected, 'SickGear' is used"></i> <b>Release Group:</b></td>
<td>%RG</td>
<td>-%RG</td>
<td>RLSGROUP</td>
</tr>
<tr>
@ -865,7 +865,7 @@
</tr>
<tr class="even">
<td class="align-right"><i class="icon-info-sign" title="If RLSGROUP is not detected, 'SickGear' is used"></i> <b>Release Group:</b></td>
<td>%RG</td>
<td>-%RG</td>
<td>RLSGROUP</td>
</tr>
<tr>
@ -1063,7 +1063,7 @@
</tr>
<tr>
<td class="align-right"><i class="icon-info-sign" title="If RLSGROUP is not detected, 'SickGear' is used"></i> <b>Release Group:</b></td>
<td>%RG</td>
<td>[%RG]</td>
<td>RLSGROUP</td>
</tr>
<tr class="even">

View file

@ -525,4 +525,28 @@ $(document).ready(function () {
}
});
$('.config_submitter').on('click', (function() {
var save_config = true;
$('#naming_pattern, #naming_abd_pattern, #naming_sports_pattern').each(function() {
if (/^((?=.*%RG)(?:(?!-%RG).)*)$/.test($(this).val())
|| /^((?=.*%rg)(?:(?!-%rg).)*)$/i.test($(this).val())) {
$(this).focus();
alert('You must insert a minus symbol before the %RG/%rg token i.e. -%RG, or -%rg');
save_config = false;
return save_config;
}
});
if (save_config) {
$('#naming_anime_pattern').each(function() {
if (/^((?=.*%RG)(?:(?!\[%RG\]).)*)$/.test($(this).val())
|| /^((?=.*%rg)(?:(?!\[%rg\]).)*)$/i.test($(this).val())) {
$(this).focus();
alert('You must insert a bracket around the %RG/%rg token i.e. [%RG], or [%rg]');
save_config = false;
return save_config;
}
});
}
return save_config;
}))
});