mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-23 01:43: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
|
||||||
|
|
|
@ -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 />
|
||||||
|
|
|
@ -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,6 +97,7 @@ 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):
|
||||||
|
@ -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