mirror of
https://github.com/SickGear/SickGear.git
synced 2025-03-15 09:07:43 +00:00
Add version to anime renaming pattern
This commit is contained in:
parent
4c54e6e356
commit
5eb1b47300
6 changed files with 28 additions and 17 deletions
|
@ -72,6 +72,7 @@
|
||||||
* Add genres and rating to all Trakt shows
|
* Add genres and rating to all Trakt shows
|
||||||
* Add AniDb Random and Hot to Add Show page
|
* Add AniDb Random and Hot to Add Show page
|
||||||
* Add IMDb Popular to Add Show page
|
* Add IMDb Popular to Add Show page
|
||||||
|
* Add version to anime renaming pattern
|
||||||
|
|
||||||
[develop changelog]
|
[develop changelog]
|
||||||
Enable Alpha Ratio again now that the secure login page over https is fixed
|
Enable Alpha Ratio again now that the secure login page over https is fixed
|
||||||
|
|
|
@ -17,9 +17,9 @@
|
||||||
<script type="text/javascript" src="$sbRoot/js/configPostProcessing.js?v=$sbPID"></script>
|
<script type="text/javascript" src="$sbRoot/js/configPostProcessing.js?v=$sbPID"></script>
|
||||||
<script type="text/javascript" src="$sbRoot/js/config.js?v=$sbPID"></script>
|
<script type="text/javascript" src="$sbRoot/js/config.js?v=$sbPID"></script>
|
||||||
|
|
||||||
#if $varExists('header')
|
#if $varExists('header')
|
||||||
<h1 class="header">$header</h1>
|
<h1 class="header">$header</h1>
|
||||||
#else
|
#else
|
||||||
<h1 class="title">$title</h1>
|
<h1 class="title">$title</h1>
|
||||||
#end if
|
#end if
|
||||||
|
|
||||||
|
@ -1073,6 +1073,11 @@
|
||||||
<td>%RT</td>
|
<td>%RT</td>
|
||||||
<td>PROPER</td>
|
<td>PROPER</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr class="even">
|
||||||
|
<td class="align-right"><b>Version:</b></td>
|
||||||
|
<td>%V</td>
|
||||||
|
<td>2</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<br />
|
<br />
|
||||||
|
|
|
@ -11,7 +11,7 @@ $(document).ready(function () {
|
||||||
|
|
||||||
function israr_supported() {
|
function israr_supported() {
|
||||||
var pattern = $('#naming_pattern').val();
|
var pattern = $('#naming_pattern').val();
|
||||||
$.get(sbRoot + '/config/postProcessing/isRarSupported',
|
$.get(sbRoot + '/config/postProcessing/isRarSupported',
|
||||||
function (data) {
|
function (data) {
|
||||||
if (data == "supported") {
|
if (data == "supported") {
|
||||||
} else {
|
} else {
|
||||||
|
@ -21,11 +21,11 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
$('#unpack').qtip('toggle', true);
|
$('#unpack').qtip('toggle', true);
|
||||||
$('#unpack').css('background-color', '#FFFFDD');
|
$('#unpack').css('background-color', '#FFFFDD');
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function fill_examples() {
|
function fill_examples() {
|
||||||
var pattern = $('#naming_pattern').val();
|
var pattern = $('#naming_pattern').val();
|
||||||
var multi = $('#naming_multi_ep :selected').val();
|
var multi = $('#naming_multi_ep :selected').val();
|
||||||
|
@ -207,7 +207,7 @@ $(document).ready(function () {
|
||||||
var multi = $('#naming_anime_multi_ep :selected').val();
|
var multi = $('#naming_anime_multi_ep :selected').val();
|
||||||
var anime_type = $('input[name="naming_anime"]:checked').val();
|
var anime_type = $('input[name="naming_anime"]:checked').val();
|
||||||
|
|
||||||
$.get(sbRoot + '/config/postProcessing/testNaming', {pattern: pattern, anime_type: anime_type},
|
$.get(sbRoot + '/config/postProcessing/testNaming', {pattern: pattern, anime: 'True', anime_type: anime_type},
|
||||||
function (data) {
|
function (data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
$('#naming_example_anime').text(data + '.ext');
|
$('#naming_example_anime').text(data + '.ext');
|
||||||
|
@ -217,7 +217,7 @@ $(document).ready(function () {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$.get(sbRoot + '/config/postProcessing/testNaming', {pattern: pattern, multi: multi, anime_type: anime_type},
|
$.get(sbRoot + '/config/postProcessing/testNaming', {pattern: pattern, multi: multi, anime: 'True', anime_type: anime_type},
|
||||||
function (data) {
|
function (data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
$('#naming_example_multi_anime').text(data + '.ext');
|
$('#naming_example_multi_anime').text(data + '.ext');
|
||||||
|
@ -227,7 +227,7 @@ $(document).ready(function () {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$.get(sbRoot + '/config/postProcessing/isNamingValid', {pattern: pattern, multi: multi, anime_type: anime_type},
|
$.get(sbRoot + '/config/postProcessing/isNamingValid', {pattern: pattern, multi: multi, anime: 'True', anime_type: anime_type},
|
||||||
function (data) {
|
function (data) {
|
||||||
if (data == "invalid") {
|
if (data == "invalid") {
|
||||||
$('#naming_anime_pattern').qtip('option', {
|
$('#naming_anime_pattern').qtip('option', {
|
||||||
|
|
|
@ -97,13 +97,14 @@ class TVEpisode(tv.TVEpisode):
|
||||||
self._status = Quality.compositeStatus(common.DOWNLOADED, common.Quality.SDTV)
|
self._status = Quality.compositeStatus(common.DOWNLOADED, common.Quality.SDTV)
|
||||||
self._release_name = 'Show.Name.S02E03.HDTV.XviD-RLSGROUP'
|
self._release_name = 'Show.Name.S02E03.HDTV.XviD-RLSGROUP'
|
||||||
self._is_proper = True
|
self._is_proper = True
|
||||||
|
self._version = 2
|
||||||
|
|
||||||
|
|
||||||
def check_force_season_folders(pattern=None, multi=None, anime_type=None):
|
def check_force_season_folders(pattern=None, multi=None, anime_type=None):
|
||||||
"""
|
"""
|
||||||
Checks if the name can still be parsed if you strip off the folders to determine if we need to force season folders
|
Checks if the name can still be parsed if you strip off the folders to determine if we need to force season folders
|
||||||
to be enabled or not.
|
to be enabled or not.
|
||||||
|
|
||||||
Returns true if season folders need to be forced on or false otherwise.
|
Returns true if season folders need to be forced on or false otherwise.
|
||||||
"""
|
"""
|
||||||
if pattern == None:
|
if pattern == None:
|
||||||
|
@ -123,7 +124,7 @@ def check_force_season_folders(pattern=None, multi=None, anime_type=None):
|
||||||
def check_valid_naming(pattern=None, multi=None, anime_type=None):
|
def check_valid_naming(pattern=None, multi=None, anime_type=None):
|
||||||
"""
|
"""
|
||||||
Checks if the name is can be parsed back to its original form for both single and multi episodes.
|
Checks if the name is can be parsed back to its original form for both single and multi episodes.
|
||||||
|
|
||||||
Returns true if the naming is valid, false if not.
|
Returns true if the naming is valid, false if not.
|
||||||
"""
|
"""
|
||||||
if pattern == None:
|
if pattern == None:
|
||||||
|
@ -145,7 +146,7 @@ def check_valid_naming(pattern=None, multi=None, anime_type=None):
|
||||||
def check_valid_abd_naming(pattern=None):
|
def check_valid_abd_naming(pattern=None):
|
||||||
"""
|
"""
|
||||||
Checks if the name is can be parsed back to its original form for an air-by-date format.
|
Checks if the name is can be parsed back to its original form for an air-by-date format.
|
||||||
|
|
||||||
Returns true if the naming is valid, false if not.
|
Returns true if the naming is valid, false if not.
|
||||||
"""
|
"""
|
||||||
if pattern == None:
|
if pattern == None:
|
||||||
|
@ -213,13 +214,16 @@ def validate_name(pattern, multi=None, anime_type=None, file_only=False, abd=Fal
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def generate_sample_ep(multi=None, abd=False, sports=False, anime_type=None):
|
def generate_sample_ep(multi=None, abd=False, sports=False, anime=False, anime_type=None):
|
||||||
# make a fake episode object
|
# make a fake episode object
|
||||||
ep = TVEpisode(2, 3, 3, "Ep Name")
|
ep = TVEpisode(2, 3, 3, "Ep Name")
|
||||||
|
|
||||||
ep._status = Quality.compositeStatus(DOWNLOADED, Quality.HDTV)
|
ep._status = Quality.compositeStatus(DOWNLOADED, Quality.HDTV)
|
||||||
ep._airdate = datetime.date(2011, 3, 9)
|
ep._airdate = datetime.date(2011, 3, 9)
|
||||||
|
|
||||||
|
if anime:
|
||||||
|
ep.show.anime = 1
|
||||||
|
|
||||||
if abd:
|
if abd:
|
||||||
ep._release_name = 'Show.Name.2011.03.09.HDTV.XviD-RLSGROUP'
|
ep._release_name = 'Show.Name.2011.03.09.HDTV.XviD-RLSGROUP'
|
||||||
ep.show.air_by_date = 1
|
ep.show.air_by_date = 1
|
||||||
|
@ -263,7 +267,7 @@ def generate_sample_ep(multi=None, abd=False, sports=False, anime_type=None):
|
||||||
return ep
|
return ep
|
||||||
|
|
||||||
|
|
||||||
def test_name(pattern, multi=None, abd=False, sports=False, anime_type=None):
|
def test_name(pattern, multi=None, abd=False, sports=False, anime=False, anime_type=None):
|
||||||
ep = generate_sample_ep(multi, abd, sports, anime_type)
|
ep = generate_sample_ep(multi, abd, sports, anime, anime_type)
|
||||||
|
|
||||||
return {'name': ep.formatted_filename(pattern, multi, anime_type), 'dir': ep.formatted_dir(pattern, multi)}
|
return {'name': ep.formatted_filename(pattern, multi, anime_type), 'dir': ep.formatted_dir(pattern, multi)}
|
|
@ -2217,6 +2217,7 @@ class TVEpisode(object):
|
||||||
'%0M': '%02d' % self.airdate.month,
|
'%0M': '%02d' % self.airdate.month,
|
||||||
'%0D': '%02d' % self.airdate.day,
|
'%0D': '%02d' % self.airdate.day,
|
||||||
'%RT': "PROPER" if self.is_proper else "",
|
'%RT': "PROPER" if self.is_proper else "",
|
||||||
|
'%V': 'v%s' % self.version if self.show.is_anime and self.version > 1 else '',
|
||||||
}
|
}
|
||||||
|
|
||||||
def _format_string(self, pattern, replace_map):
|
def _format_string(self, pattern, replace_map):
|
||||||
|
|
|
@ -4122,7 +4122,7 @@ class ConfigPostProcessing(Config):
|
||||||
|
|
||||||
self.redirect('/config/postProcessing/')
|
self.redirect('/config/postProcessing/')
|
||||||
|
|
||||||
def testNaming(self, pattern=None, multi=None, abd=False, sports=False, anime_type=None):
|
def testNaming(self, pattern=None, multi=None, abd=False, sports=False, anime=False, anime_type=None):
|
||||||
|
|
||||||
if multi is not None:
|
if multi is not None:
|
||||||
multi = int(multi)
|
multi = int(multi)
|
||||||
|
@ -4130,13 +4130,13 @@ class ConfigPostProcessing(Config):
|
||||||
if anime_type is not None:
|
if anime_type is not None:
|
||||||
anime_type = int(anime_type)
|
anime_type = int(anime_type)
|
||||||
|
|
||||||
result = naming.test_name(pattern, multi, abd, sports, anime_type)
|
result = naming.test_name(pattern, multi, abd, sports, anime, anime_type)
|
||||||
|
|
||||||
result = ek.ek(os.path.join, result['dir'], result['name'])
|
result = ek.ek(os.path.join, result['dir'], result['name'])
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def isNamingValid(self, pattern=None, multi=None, abd=False, sports=False, anime_type=None):
|
def isNamingValid(self, pattern=None, multi=None, abd=False, sports=False, anime=False, anime_type=None):
|
||||||
if pattern is None:
|
if pattern is None:
|
||||||
return 'invalid'
|
return 'invalid'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue