1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-11-14 21:35:03 -05:00

Custom naming for anime

This commit is contained in:
adam 2014-09-28 17:20:42 +08:00
parent 164724a63d
commit 37f021feb6
6 changed files with 396 additions and 75 deletions

View File

@ -477,58 +477,6 @@
<br/> <br/>
</div> </div>
<div id="naming_example_anime_div">
<h2>Single-EP Anime Sample:</h2>
<div class="example">
<span class="jumbo" id="naming_example_anime">&nbsp;</span>
</div>
<br/>
</div>
<div id="naming_example_multi_anime_div">
<h2>Multi-EP Anime sample:</h2>
<div class="example">
<span class="jumbo" id="naming_example_multi_anime">&nbsp;</span>
</div>
<br/>
</div>
<div class="field-pair">
<input type="radio" name="naming_anime" id="naming_anime" value="1" #if $sickbeard.NAMING_ANIME == 1 then "checked=\"checked\"" else ""#/>
<label class="clearfix" for="naming_anime">
<span class="component-title">Add Absolute Number</span>
<span class="component-desc">Add the absolute number to the season/episode format?</span>
</label>
<label class="nocheck clearfix">
<span class="component-title">&nbsp;</span>
<span class="component-desc">Only applies to animes. (eg. S15E45 - 310 vs S15E45)</span>
</label>
</div>
<div class="field-pair">
<input type="radio" name="naming_anime" id="naming_anime_only" value="2" #if $sickbeard.NAMING_ANIME == 2 then "checked=\"checked\"" else ""#/>
<label class="clearfix" for="naming_anime_only">
<span class="component-title">Only Absolute Number</span>
<span class="component-desc">Replace season/episode format with absolute number</span>
</label>
<label class="nocheck clearfix">
<span class="component-title">&nbsp;</span>
<span class="component-desc">Only applies to animes.</span>
</label>
</div>
<div class="field-pair">
<input type="radio" name="naming_anime" id="naming_anime_none" value="3" #if $sickbeard.NAMING_ANIME == 3 then "checked=\"checked\"" else ""#/>
<label class="clearfix" for="naming_anime_none">
<span class="component-title">No Absolute Number</span>
<span class="component-desc">Dont include the absolute number</span>
</label>
<label class="nocheck clearfix">
<span class="component-title">&nbsp;</span>
<span class="component-desc">Only applies to animes.</span>
</label>
</div>
<div class="field-pair"> <div class="field-pair">
<input type="checkbox" id="naming_strip_year" name="naming_strip_year" #if $sickbeard.NAMING_STRIP_YEAR then "checked=\"checked\"" else ""#/> <input type="checkbox" id="naming_strip_year" name="naming_strip_year" #if $sickbeard.NAMING_STRIP_YEAR then "checked=\"checked\"" else ""#/>
<label class="clearfix" for="naming_strip_year"> <label class="clearfix" for="naming_strip_year">
@ -895,6 +843,241 @@
</div><!-- /naming_sports_different --> </div><!-- /naming_sports_different -->
<!-- naming_anime_custom -->
<div class="field-pair clearfix">
<input type="checkbox" class="enabler" id="naming_custom_anime" name="naming_custom_anime" #if $sickbeard.NAMING_CUSTOM_ANIME then "checked=\"checked\"" else ""#/>
<label class="clearfix" for="naming_custom_anime">
<span class="component-title">Custom Anime</span>
<span class="component-desc">Name Anime shows differently than regular shows?</span>
</label>
</div>
<div id="content_naming_custom_anime">
<div class="field-pair">
<label class="nocheck clearfix" for="name_anime_presets">
<span class="component-title">Name Pattern:</span>
<span class="component-desc">
<select id="name_anime_presets">
#set is_anime_custom = True
#for $cur_preset in $naming.name_anime_presets:
#set $tmp = $naming.test_name($cur_preset)
#if $cur_preset == $sickbeard.NAMING_ANIME_PATTERN:
#set is_anime_custom = False
#end if
<option id="$cur_preset" #if $cur_preset == $sickbeard.NAMING_ANIME_PATTERN then "selected=\"selected\"" else ""#>$os.path.join($tmp['dir'], $tmp['name'])</option>
#end for
<option id="$sickbeard.NAMING_ANIME_PATTERN" #if $is_anime_custom then "selected=\"selected\"" else ""#>Custom...</option>
</select>
</span>
</label>
</div>
<div id="naming_anime_custom">
<div class="field-pair clearfix" style="padding-top: 0;">
<label class="nocheck clearfix">
<span class="component-title">
&nbsp;
</span>
<span class="component-desc">
<input type="text" size="45" name="naming_anime_pattern" id="naming_anime_pattern" class="custom-pattern" value="$sickbeard.NAMING_ANIME_PATTERN" style="font-size: 13px; height: 18px; margin-top: -8px"/>
<img src="$sbRoot/images/legend16.png" width="16" height="16" alt="[Toggle Key]" id="show_naming_anime_key" title="Toggle anime Naming Legend" style="padding: 0 0 0 3px; margin-top: -2px;" />
</span>
</label>
</div>
<div id="naming_anime_key" class="nocheck clearfix" style="display: none;">
<table class="Key">
<thead>
<tr>
<th class="align-right">Meaning</th>
<th>Pattern</th>
<th width="60%">Result</th>
</tr>
</thead>
<tfoot>
<tr>
<th colspan="3">Use lower case if you want lower case names (eg. %sn, %e.n, %q_n etc)</th>
</tr>
</tfoot>
<tbody>
<tr>
<td class="align-right"><b>Show Name:</b></td>
<td>%SN</td>
<td>Show Name</td>
</tr>
<tr class="even">
<td>&nbsp;</td>
<td>%S.N</td>
<td>Show.Name</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>%S_N</td>
<td>Show_Name</td>
</tr>
<tr class="even">
<td class="align-right"><b>Anime Air Date:</b></td>
<td>%AD</td>
<td>9 Mar 2011</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>%A.D</td>
<td>9.Mar.2011</td>
</tr>
<tr class="even">
<td>&nbsp;</td>
<td>%A_D</td>
<td>9_Mar_2011</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>%A-D</td>
<td>9-Mar-2011</td>
</tr>
<tr class="even">
<td class="align-right"><b>Episode Name:</b></td>
<td>%EN</td>
<td>Episode Name</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>%E.N</td>
<td>Episode.Name</td>
</tr>
<tr class="even">
<td>&nbsp;</td>
<td>%E_N</td>
<td>Episode_Name</td>
</tr>
<tr>
<td class="align-right"><b>Quality:</b></td>
<td>%QN</td>
<td>720p BluRay</td>
</tr>
<tr class="even">
<td>&nbsp;</td>
<td>%Q.N</td>
<td>720p.BluRay</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>%Q_N</td>
<td>720p_BluRay</td>
</tr>
<tr class="even">
<td class="align-right"><b>Year:</b></td>
<td>%Y</td>
<td>2010</td>
</tr>
<tr>
<td class="align-right"><b>Month:</b></td>
<td>%M</td>
<td>3</td>
</tr>
<tr class="even">
<td class="align-right">&nbsp;</td>
<td>%0M</td>
<td>03</td>
</tr>
<tr>
<td class="align-right"><b>Day:</b></td>
<td>%D</td>
<td>9</td>
</tr>
<tr class="even">
<td class="align-right">&nbsp;</td>
<td>%0D</td>
<td>09</td>
</tr>
<tr>
<td class="align-right"><i class="icon-info-sign" title="Multi-EP style is ignored"></i> <b>Release Name:</b></td>
<td>%RN</td>
<td>Show.Name.9th.Mar.2011.HDTV.XviD-RLSGROUP</td>
</tr>
<tr class="even">
<td class="align-right"><i class="icon-info-sign" title="'SiCKRAGE' is used in place of RLSGROUP if it could not be properly detected"></i> <b>Release Group:</b></td>
<td>%RG</td>
<td>RLSGROUP</td>
</tr>
<tr>
<td class="align-right"><i class="icon-info-sign" title="If episode is proper/repack add 'proper' to name."></i> <b>Release Type:</b></td>
<td>%RT</td>
<td>PROPER</td>
</tr>
</tbody>
</table>
<br/>
</div>
</div><!-- /naming_anime_custom -->
<div class="field-pair">
<label class="nocheck clearfix" for="naming_anime_multi_ep">
<span class="component-title">Multi-Episode Style:</span>
<span class="component-desc">
<select id="naming_anime_multi_ep" name="naming_anime_multi_ep">
#for $cur_multi_ep in sorted($multiEpStrings.items(), key=lambda x: x[1]):
<option value="$cur_multi_ep[0]" #if $cur_multi_ep[0] == $sickbeard.NAMING_ANIME_MULTI_EP then "selected=\"selected\" class=\"selected\"" else ""#>$cur_multi_ep[1]</option>
#end for
</select>
</span>
</label>
</div>
<div id="naming_example_anime_div">
<h2>Single-EP Anime Sample:</h2>
<div class="example">
<span class="jumbo" id="naming_example_anime">&nbsp;</span>
</div>
<br/>
</div>
<div id="naming_example_multi_anime_div">
<h2>Multi-EP Anime sample:</h2>
<div class="example">
<span class="jumbo" id="naming_example_multi_anime">&nbsp;</span>
</div>
<br/>
</div>
<div class="field-pair">
<input type="radio" name="naming_anime" id="naming_anime" value="1" #if $sickbeard.NAMING_ANIME == 1 then "checked=\"checked\"" else ""#/>
<label class="clearfix" for="naming_anime">
<span class="component-title">Add Absolute Number</span>
<span class="component-desc">Add the absolute number to the season/episode format?</span>
</label>
<label class="nocheck clearfix">
<span class="component-title">&nbsp;</span>
<span class="component-desc">Only applies to animes. (eg. S15E45 - 310 vs S15E45)</span>
</label>
</div>
<div class="field-pair">
<input type="radio" name="naming_anime" id="naming_anime_only" value="2" #if $sickbeard.NAMING_ANIME == 2 then "checked=\"checked\"" else ""#/>
<label class="clearfix" for="naming_anime_only">
<span class="component-title">Only Absolute Number</span>
<span class="component-desc">Replace season/episode format with absolute number</span>
</label>
<label class="nocheck clearfix">
<span class="component-title">&nbsp;</span>
<span class="component-desc">Only applies to animes.</span>
</label>
</div>
<div class="field-pair">
<input type="radio" name="naming_anime" id="naming_anime_none" value="3" #if $sickbeard.NAMING_ANIME == 3 then "checked=\"checked\"" else ""#/>
<label class="clearfix" for="naming_anime_none">
<span class="component-title">No Absolute Number</span>
<span class="component-desc">Dont include the absolute number</span>
</label>
<label class="nocheck clearfix">
<span class="component-title">&nbsp;</span>
<span class="component-desc">Only applies to animes.</span>
</label>
</div>
</div><!-- /naming_anime_different -->
<div class="clearfix"></div> <div class="clearfix"></div>
<input type="submit" class="btn config_submitter" value="Save Changes" /><br/> <input type="submit" class="btn config_submitter" value="Save Changes" /><br/>

View File

@ -51,26 +51,6 @@ $(document).ready(function () {
} }
}); });
$.get(sbRoot + '/config/postProcessing/testNaming', {pattern: pattern, anime_type: anime_type},
function (data) {
if (data) {
$('#naming_example_anime').text(data + '.ext');
$('#naming_example_anime_div').show();
} else {
$('#naming_example_anime_div').hide();
}
});
$.get(sbRoot + '/config/postProcessing/testNaming', {pattern: pattern, multi: multi, anime_type: anime_type},
function (data) {
if (data) {
$('#naming_example_multi_anime').text(data + '.ext');
$('#naming_example_multi_anime_div').show();
} else {
$('#naming_example_multi_anime_div').hide();
}
});
$.get(sbRoot + '/config/postProcessing/isNamingValid', {pattern: pattern, multi: multi, anime_type: anime_type}, $.get(sbRoot + '/config/postProcessing/isNamingValid', {pattern: pattern, multi: multi, anime_type: anime_type},
function (data) { function (data) {
if (data == "invalid") { if (data == "invalid") {
@ -181,6 +161,99 @@ $(document).ready(function () {
} }
function fill_sports_examples() {
var pattern = $('#naming_sports_pattern').val();
$.get(sbRoot + '/config/postProcessing/testNaming', {pattern: pattern, sports: 'True'},
function (data) {
if (data) {
$('#naming_sports_example').text(data + '.ext');
$('#naming_sports_example_div').show();
} else {
$('#naming_sports_example_div').hide();
}
});
$.get(sbRoot + '/config/postProcessing/isNamingValid', {pattern: pattern, sports: 'True'},
function (data) {
if (data == "invalid") {
$('#naming_sports_pattern').qtip('option', {
'content.text': 'This pattern is invalid.',
'style.classes': 'qtip-rounded qtip-shadow qtip-red'
});
$('#naming_sports_pattern').qtip('toggle', true);
$('#naming_sports_pattern').css('background-color', '#FFDDDD');
} else if (data == "seasonfolders") {
$('#naming_sports_pattern').qtip('option', {
'content.text': 'This pattern would be invalid without the folders, using it will force "Flatten" off for all shows.',
'style.classes': 'qtip-rounded qtip-shadow qtip-red'
});
$('#naming_sports_pattern').qtip('toggle', true);
$('#naming_sports_pattern').css('background-color', '#FFFFDD');
} else {
$('#naming_sports_pattern').qtip('option', {
'content.text': 'This pattern is valid.',
'style.classes': 'qtip-rounded qtip-shadow qtip-green'
});
$('#naming_sports_pattern').qtip('toggle', false);
$('#naming_sports_pattern').css('background-color', '#FFFFFF');
}
});
}
function fill_anime_examples() {
var pattern = $('#naming_anime_pattern').val();
var multi = $('#naming_anime_multi_ep :selected').val();
var anime_type = $('input[name="naming_anime"]:checked').val();
$.get(sbRoot + '/config/postProcessing/testNaming', {pattern: pattern, anime_type: anime_type},
function (data) {
if (data) {
$('#naming_example_anime').text(data + '.ext');
$('#naming_example_anime_div').show();
} else {
$('#naming_example_anime_div').hide();
}
});
$.get(sbRoot + '/config/postProcessing/testNaming', {pattern: pattern, multi: multi, anime_type: anime_type},
function (data) {
if (data) {
$('#naming_example_multi_anime').text(data + '.ext');
$('#naming_example_multi_anime_div').show();
} else {
$('#naming_example_multi_anime_div').hide();
}
});
$.get(sbRoot + '/config/postProcessing/isNamingValid', {pattern: pattern, multi: multi, anime_type: anime_type},
function (data) {
if (data == "invalid") {
$('#naming_pattern').qtip('option', {
'content.text': 'This pattern is invalid.',
'style.classes': 'qtip-rounded qtip-shadow qtip-red'
});
$('#naming_pattern').qtip('toggle', true);
$('#naming_pattern').css('background-color', '#FFDDDD');
} else if (data == "seasonfolders") {
$('#naming_pattern').qtip('option', {
'content.text': 'This pattern would be invalid without the folders, using it will force "Flatten" off for all shows.',
'style.classes': 'qtip-rounded qtip-shadow qtip-red'
});
$('#naming_pattern').qtip('toggle', true);
$('#naming_pattern').css('background-color', '#FFFFDD');
} else {
$('#naming_pattern').qtip('option', {
'content.text': 'This pattern is valid.',
'style.classes': 'qtip-rounded qtip-shadow qtip-green'
});
$('#naming_pattern').qtip('toggle', false);
$('#naming_pattern').css('background-color', '#FFFFFF');
}
});
}
function setup_naming() { function setup_naming() {
// if it is a custom selection then show the text box // if it is a custom selection then show the text box
if ($('#name_presets :selected').val() == "Custom...") { if ($('#name_presets :selected').val() == "Custom...") {
@ -214,6 +287,17 @@ $(document).ready(function () {
fill_sports_examples(); fill_sports_examples();
} }
function setup_anime_naming() {
// if it is a custom selection then show the text box
if ($('#name_anime_presets :selected').val() == "Custom...") {
$('#naming_anime_custom').show();
} else {
$('#naming_anime_custom').hide();
$('#naming_anime_pattern').val($('#name_anime_presets :selected').attr('id'));
}
fill_anime_examples();
}
$('#unpack').change(function () { $('#unpack').change(function () {
if(this.checked) { if(this.checked) {
israr_supported(); israr_supported();
@ -242,8 +326,16 @@ $(document).ready(function () {
setup_sports_naming(); setup_sports_naming();
}); });
$('#name_anime_presets').change(function () {
setup_anime_naming();
});
$('#naming_custom_anime').change(function () {
setup_anime_naming();
});
$('input[name="naming_anime"]').click(function(){ $('input[name="naming_anime"]').click(function(){
setup_naming(); setup_anime_naming();
}); });
$('#naming_multi_ep').change(fill_examples); $('#naming_multi_ep').change(fill_examples);
@ -254,6 +346,14 @@ $(document).ready(function () {
}, 500); }, 500);
}); });
$('#naming_anime_multi_ep').change(fill_anime_examples);
$('#naming_anime_pattern').focusout(fill_anime_examples);
$('#naming_anime_pattern').keyup(function () {
typewatch(function () {
fill_anime_examples();
}, 500);
});
$('#naming_abd_pattern').focusout(fill_examples); $('#naming_abd_pattern').focusout(fill_examples);
$('#naming_abd_pattern').keyup(function () { $('#naming_abd_pattern').keyup(function () {
typewatch(function () { typewatch(function () {
@ -268,6 +368,13 @@ $(document).ready(function () {
}, 500); }, 500);
}); });
$('#naming_anime_pattern').focusout(fill_examples);
$('#naming_anime_pattern').keyup(function () {
typewatch(function () {
fill_anime_examples();
}, 500);
});
$('#show_naming_key').click(function () { $('#show_naming_key').click(function () {
$('#naming_key').toggle(); $('#naming_key').toggle();
}); });
@ -285,6 +392,8 @@ $(document).ready(function () {
setup_naming(); setup_naming();
setup_abd_naming(); setup_abd_naming();
setup_sports_naming(); setup_sports_naming();
setup_anime_naming();
// -- start of metadata options div toggle code -- // -- start of metadata options div toggle code --
$('#metadataType').on('change keyup', function () { $('#metadataType').on('change keyup', function () {

View File

@ -168,11 +168,14 @@ ANIME_DEFAULT = False
PROVIDER_ORDER = [] PROVIDER_ORDER = []
NAMING_MULTI_EP = False NAMING_MULTI_EP = False
NAMING_ANIME_MULTI_EP = False
NAMING_PATTERN = None NAMING_PATTERN = None
NAMING_ABD_PATTERN = None NAMING_ABD_PATTERN = None
NAMING_CUSTOM_ABD = False NAMING_CUSTOM_ABD = False
NAMING_SPORTS_PATTERN = None NAMING_SPORTS_PATTERN = None
NAMING_CUSTOM_SPORTS = False NAMING_CUSTOM_SPORTS = False
NAMING_ANIME_PATTERN = None
NAMING_CUSTOM_ANIME = False
NAMING_FORCE_FOLDERS = False NAMING_FORCE_FOLDERS = False
NAMING_STRIP_YEAR = False NAMING_STRIP_YEAR = False
NAMING_ANIME = None NAMING_ANIME = None
@ -476,7 +479,7 @@ def initialize(consoleLogging=True):
versionCheckScheduler, VERSION_NOTIFY, AUTO_UPDATE, NOTIFY_ON_UPDATE, PROCESS_AUTOMATICALLY, UNPACK, CPU_PRESET, \ versionCheckScheduler, VERSION_NOTIFY, AUTO_UPDATE, NOTIFY_ON_UPDATE, PROCESS_AUTOMATICALLY, UNPACK, CPU_PRESET, \
KEEP_PROCESSED_DIR, PROCESS_METHOD, TV_DOWNLOAD_DIR, MIN_DAILYSEARCH_FREQUENCY, DEFAULT_UPDATE_FREQUENCY, MIN_UPDATE_FREQUENCY, UPDATE_FREQUENCY, \ KEEP_PROCESSED_DIR, PROCESS_METHOD, TV_DOWNLOAD_DIR, MIN_DAILYSEARCH_FREQUENCY, DEFAULT_UPDATE_FREQUENCY, MIN_UPDATE_FREQUENCY, UPDATE_FREQUENCY, \
showQueueScheduler, searchQueueScheduler, ROOT_DIRS, CACHE_DIR, ACTUAL_CACHE_DIR, TIMEZONE_DISPLAY, \ showQueueScheduler, searchQueueScheduler, ROOT_DIRS, CACHE_DIR, ACTUAL_CACHE_DIR, TIMEZONE_DISPLAY, \
NAMING_PATTERN, NAMING_MULTI_EP, NAMING_FORCE_FOLDERS, NAMING_ABD_PATTERN, NAMING_CUSTOM_ABD, NAMING_SPORTS_PATTERN, NAMING_CUSTOM_SPORTS, NAMING_STRIP_YEAR, \ NAMING_PATTERN, NAMING_MULTI_EP, NAMING_ANIME_MULTI_EP, NAMING_FORCE_FOLDERS, NAMING_ABD_PATTERN, NAMING_CUSTOM_ABD, NAMING_SPORTS_PATTERN, NAMING_CUSTOM_SPORTS, NAMING_ANIME_PATTERN, NAMING_CUSTOM_ANIME, NAMING_STRIP_YEAR, \
RENAME_EPISODES, AIRDATE_EPISODES, properFinderScheduler, PROVIDER_ORDER, autoPostProcesserScheduler, \ RENAME_EPISODES, AIRDATE_EPISODES, properFinderScheduler, PROVIDER_ORDER, autoPostProcesserScheduler, \
WOMBLE, OMGWTFNZBS, OMGWTFNZBS_USERNAME, OMGWTFNZBS_APIKEY, providerList, newznabProviderList, torrentRssProviderList, \ WOMBLE, OMGWTFNZBS, OMGWTFNZBS_USERNAME, OMGWTFNZBS_APIKEY, providerList, newznabProviderList, torrentRssProviderList, \
EXTRA_SCRIPTS, USE_TWITTER, TWITTER_USERNAME, TWITTER_PASSWORD, TWITTER_PREFIX, DAILYSEARCH_FREQUENCY, \ EXTRA_SCRIPTS, USE_TWITTER, TWITTER_USERNAME, TWITTER_PASSWORD, TWITTER_PREFIX, DAILYSEARCH_FREQUENCY, \
@ -627,9 +630,12 @@ def initialize(consoleLogging=True):
NAMING_ABD_PATTERN = check_setting_str(CFG, 'General', 'naming_abd_pattern', '%SN - %A.D - %EN') NAMING_ABD_PATTERN = check_setting_str(CFG, 'General', 'naming_abd_pattern', '%SN - %A.D - %EN')
NAMING_CUSTOM_ABD = bool(check_setting_int(CFG, 'General', 'naming_custom_abd', 0)) NAMING_CUSTOM_ABD = bool(check_setting_int(CFG, 'General', 'naming_custom_abd', 0))
NAMING_SPORTS_PATTERN = check_setting_str(CFG, 'General', 'naming_sports_pattern', '%SN - %A-D - %EN') NAMING_SPORTS_PATTERN = check_setting_str(CFG, 'General', 'naming_sports_pattern', '%SN - %A-D - %EN')
NAMING_ANIME_PATTERN = check_setting_str(CFG, 'General', 'naming_anime_pattern', 'Season %0S/%SN - S%0SE%0E - %EN')
NAMING_ANIME = check_setting_int(CFG, 'General', 'naming_anime', 3) NAMING_ANIME = check_setting_int(CFG, 'General', 'naming_anime', 3)
NAMING_CUSTOM_SPORTS = bool(check_setting_int(CFG, 'General', 'naming_custom_sports', 0)) NAMING_CUSTOM_SPORTS = bool(check_setting_int(CFG, 'General', 'naming_custom_sports', 0))
NAMING_CUSTOM_ANIME = bool(check_setting_int(CFG, 'General', 'naming_custom_anime', 0))
NAMING_MULTI_EP = check_setting_int(CFG, 'General', 'naming_multi_ep', 1) NAMING_MULTI_EP = check_setting_int(CFG, 'General', 'naming_multi_ep', 1)
NAMING_ANIME_MULTI_EP = check_setting_int(CFG, 'General', 'naming_anime_multi_ep', 1)
NAMING_FORCE_FOLDERS = naming.check_force_season_folders() NAMING_FORCE_FOLDERS = naming.check_force_season_folders()
NAMING_STRIP_YEAR = bool(check_setting_int(CFG, 'General', 'naming_strip_year', 0)) NAMING_STRIP_YEAR = bool(check_setting_int(CFG, 'General', 'naming_strip_year', 0))
@ -1396,7 +1402,10 @@ def save_config():
new_config['General']['naming_abd_pattern'] = NAMING_ABD_PATTERN new_config['General']['naming_abd_pattern'] = NAMING_ABD_PATTERN
new_config['General']['naming_custom_sports'] = int(NAMING_CUSTOM_SPORTS) new_config['General']['naming_custom_sports'] = int(NAMING_CUSTOM_SPORTS)
new_config['General']['naming_sports_pattern'] = NAMING_SPORTS_PATTERN new_config['General']['naming_sports_pattern'] = NAMING_SPORTS_PATTERN
new_config['General']['naming_custom_sports'] = int(NAMING_CUSTOM_ANIME)
new_config['General']['naming_sports_pattern'] = NAMING_ANIME_PATTERN
new_config['General']['naming_multi_ep'] = int(NAMING_MULTI_EP) new_config['General']['naming_multi_ep'] = int(NAMING_MULTI_EP)
new_config['General']['naming_anime_multi_ep'] = int(NAMING_ANIME_MULTI_EP)
new_config['General']['naming_anime'] = int(NAMING_ANIME) new_config['General']['naming_anime'] = int(NAMING_ANIME)
new_config['General']['launch_browser'] = int(LAUNCH_BROWSER) new_config['General']['launch_browser'] = int(LAUNCH_BROWSER)
new_config['General']['update_shows_on_start'] = int(UPDATE_SHOWS_ON_START) new_config['General']['update_shows_on_start'] = int(UPDATE_SHOWS_ON_START)

View File

@ -35,6 +35,8 @@ name_presets = ('%SN - %Sx%0E - %EN',
'Season %0S/%S.N.S%0SE%0E.%Q.N-%RG' 'Season %0S/%S.N.S%0SE%0E.%Q.N-%RG'
) )
name_anime_presets = name_presets
name_abd_presets = ('%SN - %A-D - %EN', name_abd_presets = ('%SN - %A-D - %EN',
'%S.N.%A.D.%E.N.%Q.N', '%S.N.%A.D.%E.N.%Q.N',
'%Y/%0M/%S.N.%A.D.%E.N-%RG' '%Y/%0M/%S.N.%A.D.%E.N-%RG'

View File

@ -2341,6 +2341,8 @@ class TVEpisode(object):
pattern = sickbeard.NAMING_ABD_PATTERN pattern = sickbeard.NAMING_ABD_PATTERN
elif self.show.sports and sickbeard.NAMING_CUSTOM_SPORTS and not self.relatedEps: elif self.show.sports and sickbeard.NAMING_CUSTOM_SPORTS and not self.relatedEps:
pattern = sickbeard.NAMING_SPORTS_PATTERN pattern = sickbeard.NAMING_SPORTS_PATTERN
elif self.show.anime and sickbeard.NAMING_CUSTOM_ANIME:
pattern = sickbeard.NAMING_ANIME_PATTERN
else: else:
pattern = sickbeard.NAMING_PATTERN pattern = sickbeard.NAMING_PATTERN
@ -2363,6 +2365,8 @@ class TVEpisode(object):
pattern = sickbeard.NAMING_ABD_PATTERN pattern = sickbeard.NAMING_ABD_PATTERN
elif self.show.sports and sickbeard.NAMING_CUSTOM_SPORTS and not self.relatedEps: elif self.show.sports and sickbeard.NAMING_CUSTOM_SPORTS and not self.relatedEps:
pattern = sickbeard.NAMING_SPORTS_PATTERN pattern = sickbeard.NAMING_SPORTS_PATTERN
elif self.show.anime and sickbeard.NAMING_CUSTOM_ANIME:
pattern = sickbeard.NAMING_ANIME_PATTERN
else: else:
pattern = sickbeard.NAMING_PATTERN pattern = sickbeard.NAMING_PATTERN

View File

@ -1714,7 +1714,9 @@ class ConfigPostProcessing(MainHandler):
naming_anime=None, naming_anime=None,
naming_abd_pattern=None, naming_strip_year=None, use_failed_downloads=None, naming_abd_pattern=None, naming_strip_year=None, use_failed_downloads=None,
delete_failed=None, extra_scripts=None, skip_removed_files=None, delete_failed=None, extra_scripts=None, skip_removed_files=None,
naming_custom_sports=None, naming_sports_pattern=None, autopostprocesser_frequency=None): naming_custom_sports=None, naming_sports_pattern=None,
naming_custom_anime=None, naming_anime_pattern=None, naming_anime_multi_ep=None,
autopostprocesser_frequency=None):
results = [] results = []
@ -1747,6 +1749,7 @@ class ConfigPostProcessing(MainHandler):
sickbeard.POSTPONE_IF_SYNC_FILES = config.checkbox_to_value(postpone_if_sync_files) sickbeard.POSTPONE_IF_SYNC_FILES = config.checkbox_to_value(postpone_if_sync_files)
sickbeard.NAMING_CUSTOM_ABD = config.checkbox_to_value(naming_custom_abd) sickbeard.NAMING_CUSTOM_ABD = config.checkbox_to_value(naming_custom_abd)
sickbeard.NAMING_CUSTOM_SPORTS = config.checkbox_to_value(naming_custom_sports) sickbeard.NAMING_CUSTOM_SPORTS = config.checkbox_to_value(naming_custom_sports)
sickbeard.NAMING_CUSTOM_ANIME = config.checkbox_to_value(naming_custom_anime)
sickbeard.NAMING_STRIP_YEAR = config.checkbox_to_value(naming_strip_year) sickbeard.NAMING_STRIP_YEAR = config.checkbox_to_value(naming_strip_year)
sickbeard.USE_FAILED_DOWNLOADS = config.checkbox_to_value(use_failed_downloads) sickbeard.USE_FAILED_DOWNLOADS = config.checkbox_to_value(use_failed_downloads)
sickbeard.DELETE_FAILED = config.checkbox_to_value(delete_failed) sickbeard.DELETE_FAILED = config.checkbox_to_value(delete_failed)
@ -1780,6 +1783,17 @@ class ConfigPostProcessing(MainHandler):
else: else:
results.append("You tried saving an invalid naming config, not saving your naming settings") results.append("You tried saving an invalid naming config, not saving your naming settings")
if self.isNamingValid(naming_anime_pattern, naming_anime_multi_ep, anime_type=naming_anime) != "invalid":
sickbeard.NAMING_ANIME_PATTERN = naming_anime_pattern
sickbeard.NAMING_ANIME_MULTI_EP = int(naming_anime_multi_ep)
sickbeard.NAMING_ANIME = int(naming_anime)
sickbeard.NAMING_FORCE_FOLDERS = naming.check_force_season_folders()
else:
if int(naming_anime) in [1, 2]:
results.append("You tried saving an invalid anime naming config, not saving your naming settings")
else:
results.append("You tried saving an invalid naming config, not saving your naming settings")
if self.isNamingValid(naming_abd_pattern, None, abd=True) != "invalid": if self.isNamingValid(naming_abd_pattern, None, abd=True) != "invalid":
sickbeard.NAMING_ABD_PATTERN = naming_abd_pattern sickbeard.NAMING_ABD_PATTERN = naming_abd_pattern
else: else: