1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-13 11:32:20 -05:00

Added ability to mass set shows to search by scene numbering.

This commit is contained in:
echel0n 2014-05-29 23:22:01 -07:00
parent a92de48aec
commit a2439c8c64
4 changed files with 53 additions and 3 deletions

View File

@ -93,6 +93,17 @@
</div><br />
</div>
<div class="optionWrapper">
<span class="selectTitle">Scene Numbering</span>
<div class="selectChoices">
<select id="edit_scene" name="scene">
<option value="keep">&lt; keep &gt;</option>
<option value="enable" #if $scene_value then "selected=\"selected\"" else ""#>enable</option>
<option value="disable" #if $scene_value == False then "selected=\"selected\"" else ""#>disable</option>
</select>
</div><br />
</div>
<div class="optionWrapper">
<span class="selectTitle">Anime</span>
<div class="selectChoices">

View File

@ -54,6 +54,7 @@ class TVShow():
self.air_by_date = 0
self.sports = 0
self.anime = 0
self.scene = 0
class TVEpisode(tv.TVEpisode):
def __init__(self, season, episode, absolute_number, name):
@ -64,6 +65,7 @@ class TVEpisode(tv.TVEpisode):
self._absolute_number = absolute_number
self._scene_season = season
self._scene_episode = episode
self._scene_absolute_number = absolute_number
self._airdate = datetime.date(2010, 3, 9)
self.show = TVShow()
self._status = Quality.compositeStatus(common.DOWNLOADED, common.Quality.SDTV)

View File

@ -1895,7 +1895,16 @@ class TVEpisode(object):
Returns: A string representing the episode's name and season/ep numbers
"""
return self._format_pattern('Indexer#:[%SN - %Sx%0E - %EN] | Scene#:[%SN - %XSx%0XE - %EN]')
if self.show.is_anime and not self.show.is_scene:
return self._format_pattern('%SN - %A - %EN')
elif self.show.is_anime and self.show.is_scene:
return self._format_pattern('%SN - %XA - %EN')
elif self.show.is_scene:
return self._format_pattern('%SN - %XSx%0XE - %EN')
elif self.show.air_by_date:
return self._format_pattern('%SN - %AD - %EN')
else:
return self._format_pattern('%SN - %Sx%0E - %EN')
def _ep_name(self):
"""
@ -2000,7 +2009,8 @@ class TVEpisode(object):
'%0XS': '%02d' % self.scene_season,
'%XE': str(self.scene_episode),
'%0XE': '%02d' % self.scene_episode,
'%AN': '%(#)03d' % {'#': self.absolute_number},
'%A': '%(#)03d' % {'#': self.absolute_number},
'%XA': '%(#)03d' % {'#': self.scene_absolute_number},
'%RN': release_name(self.release_name),
'%RG': release_group(self.release_name),
'%AD': str(self.airdate).replace('-', ' '),

View File

@ -581,6 +581,9 @@ class Manage:
subtitles_all_same = True
last_subtitles = None
scene_all_same = True
last_scene = None
root_dir_list = []
for curShow in showList:
@ -622,12 +625,19 @@ class Manage:
else:
last_subtitles = curShow.subtitles
if scene_all_same:
if last_scene not in (None, curShow.scene):
scene_all_same = False
else:
last_scene = curShow.scene
t.showList = toEdit
t.paused_value = last_paused if paused_all_same else None
t.anime_value = last_anime if anime_all_same else None
t.flatten_folders_value = last_flatten_folders if flatten_folders_all_same else None
t.quality_value = last_quality if quality_all_same else None
t.subtitles_value = last_subtitles if subtitles_all_same else None
t.scene_value = last_scene if scene_all_same else None
t.root_dir_list = root_dir_list
return _munge(t)
@ -3168,6 +3178,16 @@ class Home:
else:
do_update = True
if scene == showObj.scene:
do_update_scene_numbering = False
else:
do_update_scene_numbering = True
if anime == showObj.anime:
do_update_scene_absolute_numbering = False
else:
do_update_scene_absolute_numbering = True
if type(anyQualities) != list:
anyQualities = [anyQualities]
@ -3181,7 +3201,7 @@ class Home:
if directCall:
do_update_exceptions = False
else:
if set(exceptions_list) == set(showObj.exceptions):
if directCall or set(exceptions_list) == set(showObj.exceptions):
do_update_exceptions = False
else:
do_update_exceptions = True
@ -3303,6 +3323,13 @@ class Home:
except exceptions.CantUpdateException, e:
errors.append("Unable to force an update on scene exceptions of the show.")
if do_update_scene_numbering or do_update_scene_absolute_numbering:
try:
sickbeard.scene_numbering.xem_refresh(showObj.indexerid, showObj.indexer) # @UndefinedVariable
time.sleep(cpu_presets[sickbeard.CPU_PRESET])
except exceptions.CantUpdateException, e:
errors.append("Unable to force an update on scene numbering of the show.")
if directCall:
return errors