mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-12 11:02:21 -05:00
Fixed massEdit issues.
This commit is contained in:
parent
7c650d730c
commit
a15258c784
@ -115,6 +115,28 @@
|
|||||||
</div><br />
|
</div><br />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="optionWrapper">
|
||||||
|
<span class="selectTitle">Sports</span>
|
||||||
|
<div class="selectChoices">
|
||||||
|
<select id="edit_sports" name="sports">
|
||||||
|
<option value="keep">< keep ></option>
|
||||||
|
<option value="enable" #if $sports_value then "selected=\"selected\"" else ""#>enable</option>
|
||||||
|
<option value="disable" #if $sports_value == False then "selected=\"selected\"" else ""#>disable</option>
|
||||||
|
</select>
|
||||||
|
</div><br />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="optionWrapper">
|
||||||
|
<span class="selectTitle">Air-By-Date</span>
|
||||||
|
<div class="selectChoices">
|
||||||
|
<select id="edit_air_by_date" name="air_by_date">
|
||||||
|
<option value="keep">< keep ></option>
|
||||||
|
<option value="enable" #if $air_by_date_value then "selected=\"selected\"" else ""#>enable</option>
|
||||||
|
<option value="disable" #if $air_by_date_value == False then "selected=\"selected\"" else ""#>disable</option>
|
||||||
|
</select>
|
||||||
|
</div><br />
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="optionWrapper">
|
<div class="optionWrapper">
|
||||||
<span class="selectTitle">Subtitles<span class="separator"></span></span>
|
<span class="selectTitle">Subtitles<span class="separator"></span></span>
|
||||||
<div class="selectChoices">
|
<div class="selectChoices">
|
||||||
|
@ -948,6 +948,9 @@ class Manage(MainHandler):
|
|||||||
anime_all_same = True
|
anime_all_same = True
|
||||||
last_anime = None
|
last_anime = None
|
||||||
|
|
||||||
|
sports_all_same = True
|
||||||
|
last_sports = None
|
||||||
|
|
||||||
quality_all_same = True
|
quality_all_same = True
|
||||||
last_quality = None
|
last_quality = None
|
||||||
|
|
||||||
@ -957,6 +960,9 @@ class Manage(MainHandler):
|
|||||||
scene_all_same = True
|
scene_all_same = True
|
||||||
last_scene = None
|
last_scene = None
|
||||||
|
|
||||||
|
air_by_date_all_same = True
|
||||||
|
last_air_by_date = None
|
||||||
|
|
||||||
root_dir_list = []
|
root_dir_list = []
|
||||||
|
|
||||||
for curShow in showList:
|
for curShow in showList:
|
||||||
@ -968,17 +974,17 @@ class Manage(MainHandler):
|
|||||||
# if we know they're not all the same then no point even bothering
|
# if we know they're not all the same then no point even bothering
|
||||||
if paused_all_same:
|
if paused_all_same:
|
||||||
# if we had a value already and this value is different then they're not all the same
|
# if we had a value already and this value is different then they're not all the same
|
||||||
if last_paused not in (curShow.paused, None):
|
if last_paused not in (None, curShow.paused):
|
||||||
paused_all_same = False
|
paused_all_same = False
|
||||||
else:
|
else:
|
||||||
last_paused = curShow.paused
|
last_paused = curShow.paused
|
||||||
|
|
||||||
if anime_all_same:
|
if anime_all_same:
|
||||||
# if we had a value already and this value is different then they're not all the same
|
# if we had a value already and this value is different then they're not all the same
|
||||||
if last_anime not in (curShow.is_anime, None):
|
if last_anime not in (None, curShow.is_anime):
|
||||||
anime_all_same = False
|
anime_all_same = False
|
||||||
else:
|
else:
|
||||||
last_anime = curShow.is_anime
|
last_anime = curShow.anime
|
||||||
|
|
||||||
if flatten_folders_all_same:
|
if flatten_folders_all_same:
|
||||||
if last_flatten_folders not in (None, curShow.flatten_folders):
|
if last_flatten_folders not in (None, curShow.flatten_folders):
|
||||||
@ -1004,6 +1010,18 @@ class Manage(MainHandler):
|
|||||||
else:
|
else:
|
||||||
last_scene = curShow.scene
|
last_scene = curShow.scene
|
||||||
|
|
||||||
|
if sports_all_same:
|
||||||
|
if last_sports not in (None, curShow.sports):
|
||||||
|
sports_all_same = False
|
||||||
|
else:
|
||||||
|
last_sports = curShow.sports
|
||||||
|
|
||||||
|
if air_by_date_all_same:
|
||||||
|
if last_air_by_date not in (None, curShow.air_by_date):
|
||||||
|
air_by_date_all_same = False
|
||||||
|
else:
|
||||||
|
last_air_by_date = curShow.air_by_date
|
||||||
|
|
||||||
t.showList = toEdit
|
t.showList = toEdit
|
||||||
t.paused_value = last_paused if paused_all_same else None
|
t.paused_value = last_paused if paused_all_same else None
|
||||||
t.anime_value = last_anime if anime_all_same else None
|
t.anime_value = last_anime if anime_all_same else None
|
||||||
@ -1011,14 +1029,15 @@ class Manage(MainHandler):
|
|||||||
t.quality_value = last_quality if quality_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.subtitles_value = last_subtitles if subtitles_all_same else None
|
||||||
t.scene_value = last_scene if scene_all_same else None
|
t.scene_value = last_scene if scene_all_same else None
|
||||||
|
t.sports_value = last_sports if sports_all_same else None
|
||||||
|
t.air_by_date_value = last_air_by_date if air_by_date_all_same else None
|
||||||
t.root_dir_list = root_dir_list
|
t.root_dir_list = root_dir_list
|
||||||
|
|
||||||
return _munge(t)
|
return _munge(t)
|
||||||
|
|
||||||
|
|
||||||
def massEditSubmit(self, paused=None, anime=None, scene=None, flatten_folders=None, quality_preset=False,
|
def massEditSubmit(self, paused=None, anime=None, sports=None, scene=None, flatten_folders=None, quality_preset=False,
|
||||||
subtitles=None,
|
subtitles=None, air_by_date=None, anyQualities=[], bestQualities=[], toEdit=None, *args, **kwargs):
|
||||||
anyQualities=[], bestQualities=[], toEdit=None, *args, **kwargs):
|
|
||||||
|
|
||||||
dir_map = {}
|
dir_map = {}
|
||||||
for cur_arg in kwargs:
|
for cur_arg in kwargs:
|
||||||
@ -1052,17 +1071,29 @@ class Manage(MainHandler):
|
|||||||
new_paused = 'on' if new_paused else 'off'
|
new_paused = 'on' if new_paused else 'off'
|
||||||
|
|
||||||
if anime == 'keep':
|
if anime == 'keep':
|
||||||
new_anime = showObj.is_anime
|
new_anime = showObj.anime
|
||||||
else:
|
else:
|
||||||
new_anime = True if anime == 'enable' else False
|
new_anime = True if anime == 'enable' else False
|
||||||
new_anime = 'on' if new_anime else 'off'
|
new_anime = 'on' if new_anime else 'off'
|
||||||
|
|
||||||
|
if sports == 'keep':
|
||||||
|
new_sports = showObj.sports
|
||||||
|
else:
|
||||||
|
new_sports = True if sports == 'enable' else False
|
||||||
|
new_sports = 'on' if new_sports else 'off'
|
||||||
|
|
||||||
if scene == 'keep':
|
if scene == 'keep':
|
||||||
new_scene = showObj.is_scene
|
new_scene = showObj.is_scene
|
||||||
else:
|
else:
|
||||||
new_scene = True if scene == 'enable' else False
|
new_scene = True if scene == 'enable' else False
|
||||||
new_scene = 'on' if new_scene else 'off'
|
new_scene = 'on' if new_scene else 'off'
|
||||||
|
|
||||||
|
if air_by_date == 'keep':
|
||||||
|
new_air_by_date = showObj.air_by_date
|
||||||
|
else:
|
||||||
|
new_air_by_date = True if air_by_date == 'enable' else False
|
||||||
|
new_air_by_date = 'on' if new_air_by_date else 'off'
|
||||||
|
|
||||||
if flatten_folders == 'keep':
|
if flatten_folders == 'keep':
|
||||||
new_flatten_folders = showObj.flatten_folders
|
new_flatten_folders = showObj.flatten_folders
|
||||||
else:
|
else:
|
||||||
@ -1081,12 +1112,12 @@ class Manage(MainHandler):
|
|||||||
|
|
||||||
exceptions_list = []
|
exceptions_list = []
|
||||||
|
|
||||||
curErrors += Home(self.application, self.request).editShow(curShow, new_show_dir, anyQualities,
|
curErrors += Home.editShow(curShow, new_show_dir, anyQualities, bestQualities, exceptions_list,
|
||||||
bestQualities, exceptions_list,
|
|
||||||
flatten_folders=new_flatten_folders,
|
flatten_folders=new_flatten_folders,
|
||||||
paused=new_paused,
|
paused=new_paused, sports=new_sports,
|
||||||
subtitles=new_subtitles, anime=new_anime,
|
subtitles=new_subtitles, anime=new_anime,
|
||||||
scene=new_scene, directCall=True)
|
scene=new_scene, air_by_date=new_air_by_date,
|
||||||
|
directCall=True)
|
||||||
|
|
||||||
if curErrors:
|
if curErrors:
|
||||||
logger.log(u"Errors: " + str(curErrors), logger.ERROR)
|
logger.log(u"Errors: " + str(curErrors), logger.ERROR)
|
||||||
@ -3787,13 +3818,13 @@ class Home(MainHandler):
|
|||||||
errors.append("Unable to refresh this show: " + ex(e))
|
errors.append("Unable to refresh this show: " + ex(e))
|
||||||
|
|
||||||
showObj.paused = paused
|
showObj.paused = paused
|
||||||
|
showObj.scene = scene
|
||||||
|
showObj.anime = anime
|
||||||
|
showObj.sports = sports
|
||||||
|
showObj.subtitles = subtitles
|
||||||
|
showObj.air_by_date = air_by_date
|
||||||
|
|
||||||
if not directCall:
|
if not directCall:
|
||||||
showObj.air_by_date = air_by_date
|
|
||||||
showObj.scene = scene
|
|
||||||
showObj.sports = sports
|
|
||||||
showObj.anime = anime
|
|
||||||
showObj.subtitles = subtitles
|
|
||||||
showObj.lang = indexer_lang
|
showObj.lang = indexer_lang
|
||||||
showObj.dvdorder = dvdorder
|
showObj.dvdorder = dvdorder
|
||||||
showObj.archive_firstmatch = archive_firstmatch
|
showObj.archive_firstmatch = archive_firstmatch
|
||||||
|
Loading…
Reference in New Issue
Block a user