mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-12 11:02:21 -05:00
Merge pull request #1201 from larsjohnsen/massedit-default-episode-status
Mass update: Add option for default episode status
This commit is contained in:
commit
dc58cfd9aa
@ -58,14 +58,15 @@
|
|||||||
5: { sorter: 'anime'},
|
5: { sorter: 'anime'},
|
||||||
6: { sorter: 'flatfold'},
|
6: { sorter: 'flatfold'},
|
||||||
7: { sorter: 'paused'},
|
7: { sorter: 'paused'},
|
||||||
8: { sorter: 'status'},
|
8: { sorter: 'default_ep_status'},
|
||||||
9: { sorter: false},
|
9: { sorter: 'status'},
|
||||||
10: { sorter: false},
|
10: { sorter: false},
|
||||||
11: { sorter: false},
|
11: { sorter: false},
|
||||||
12: { sorter: false},
|
12: { sorter: false},
|
||||||
13: { sorter: false},
|
13: { sorter: false},
|
||||||
14: { sorter: false},
|
14: { sorter: false},
|
||||||
15: { sorter: false}
|
15: { sorter: false},
|
||||||
|
16: { sorter: false}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -90,6 +91,7 @@
|
|||||||
<th class="col-legend">Anime</th>
|
<th class="col-legend">Anime</th>
|
||||||
<th class="col-legend">Flat Folders</th>
|
<th class="col-legend">Flat Folders</th>
|
||||||
<th class="col-legend">Paused</th>
|
<th class="col-legend">Paused</th>
|
||||||
|
<th class="col-legend">Default Ep<br>Status</th>
|
||||||
<th class="col-legend">Status</th>
|
<th class="col-legend">Status</th>
|
||||||
<th width="1%">Update<br/><input type="checkbox" class="bulkCheck" id="updateCheck" /></th>
|
<th width="1%">Update<br/><input type="checkbox" class="bulkCheck" id="updateCheck" /></th>
|
||||||
<th width="1%">Rescan<br/><input type="checkbox" class="bulkCheck" id="refreshCheck" /></th>
|
<th width="1%">Rescan<br/><input type="checkbox" class="bulkCheck" id="refreshCheck" /></th>
|
||||||
@ -172,6 +174,7 @@
|
|||||||
<td align="center"><img src="$sbRoot/images/#if int($curShow.is_anime) == 1 then "yes16.png\" alt=\"Y\"" else "no16.png\" alt=\"N\""# width="16" height="16" /></td>
|
<td align="center"><img src="$sbRoot/images/#if int($curShow.is_anime) == 1 then "yes16.png\" alt=\"Y\"" else "no16.png\" alt=\"N\""# width="16" height="16" /></td>
|
||||||
<td align="center"><img src="$sbRoot/images/#if int($curShow.flatten_folders) == 1 then "yes16.png\" alt=\"Y\"" else "no16.png\" alt=\"N\""# width="16" height="16" /></td>
|
<td align="center"><img src="$sbRoot/images/#if int($curShow.flatten_folders) == 1 then "yes16.png\" alt=\"Y\"" else "no16.png\" alt=\"N\""# width="16" height="16" /></td>
|
||||||
<td align="center"><img src="$sbRoot/images/#if int($curShow.paused) == 1 then "yes16.png\" alt=\"Y\"" else "no16.png\" alt=\"N\""# width="16" height="16" /></td>
|
<td align="center"><img src="$sbRoot/images/#if int($curShow.paused) == 1 then "yes16.png\" alt=\"Y\"" else "no16.png\" alt=\"N\""# width="16" height="16" /></td>
|
||||||
|
<td align="center">$statusStrings[$curShow.default_ep_status]</td>
|
||||||
<td align="center">$curShow.status</td>
|
<td align="center">$curShow.status</td>
|
||||||
<td align="center">$curUpdate</td>
|
<td align="center">$curUpdate</td>
|
||||||
<td align="center">$curRefresh</td>
|
<td align="center">$curRefresh</td>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#import sickbeard
|
#import sickbeard
|
||||||
#from sickbeard import common
|
#from sickbeard import common
|
||||||
|
#from sickbeard.common import *
|
||||||
#from sickbeard import exceptions
|
#from sickbeard import exceptions
|
||||||
#set global $title="Mass Edit"
|
#set global $title="Mass Edit"
|
||||||
#set global $header="Mass Edit"
|
#set global $header="Mass Edit"
|
||||||
@ -111,6 +112,18 @@
|
|||||||
</div><br />
|
</div><br />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="optionWrapper">
|
||||||
|
<span class="selectTitle">Default Episode Status:</span>
|
||||||
|
<div class="selectChoices">
|
||||||
|
<select id="edit_default_ep_status" name="default_ep_status" class="form-control form-control-inline input-sm">
|
||||||
|
<option value="keep">< keep ></option>
|
||||||
|
#for $curStatus in [$WANTED, $SKIPPED, $ARCHIVED, $IGNORED]:
|
||||||
|
<option value="$curStatus" #if $curStatus == $default_ep_status_value then 'selected="selected"' else ''#>$statusStrings[$curStatus]</option>
|
||||||
|
#end for
|
||||||
|
</select>
|
||||||
|
</div><br />
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="optionWrapper">
|
<div class="optionWrapper">
|
||||||
<span class="selectTitle">Scene Numbering</span>
|
<span class="selectTitle">Scene Numbering</span>
|
||||||
<div class="selectChoices">
|
<div class="selectChoices">
|
||||||
|
@ -1375,13 +1375,13 @@ class Home(WebRoot):
|
|||||||
showObj.sports = sports
|
showObj.sports = sports
|
||||||
showObj.subtitles = subtitles
|
showObj.subtitles = subtitles
|
||||||
showObj.air_by_date = air_by_date
|
showObj.air_by_date = air_by_date
|
||||||
|
showObj.default_ep_status = int(defaultEpStatus)
|
||||||
|
|
||||||
if not directCall:
|
if not directCall:
|
||||||
showObj.lang = indexer_lang
|
showObj.lang = indexer_lang
|
||||||
showObj.dvdorder = dvdorder
|
showObj.dvdorder = dvdorder
|
||||||
showObj.rls_ignore_words = rls_ignore_words.strip()
|
showObj.rls_ignore_words = rls_ignore_words.strip()
|
||||||
showObj.rls_require_words = rls_require_words.strip()
|
showObj.rls_require_words = rls_require_words.strip()
|
||||||
showObj.default_ep_status = int(defaultEpStatus)
|
|
||||||
|
|
||||||
# if we change location clear the db of episodes, change it, write to db, and rescan
|
# if we change location clear the db of episodes, change it, write to db, and rescan
|
||||||
if os.path.normpath(showObj._location) != os.path.normpath(location):
|
if os.path.normpath(showObj._location) != os.path.normpath(location):
|
||||||
@ -2841,6 +2841,9 @@ class Manage(Home, WebRoot):
|
|||||||
paused_all_same = True
|
paused_all_same = True
|
||||||
last_paused = None
|
last_paused = None
|
||||||
|
|
||||||
|
default_ep_status_all_same = True
|
||||||
|
last_default_ep_status = None
|
||||||
|
|
||||||
anime_all_same = True
|
anime_all_same = True
|
||||||
last_anime = None
|
last_anime = None
|
||||||
|
|
||||||
@ -2882,6 +2885,12 @@ class Manage(Home, WebRoot):
|
|||||||
else:
|
else:
|
||||||
last_paused = curShow.paused
|
last_paused = curShow.paused
|
||||||
|
|
||||||
|
if default_ep_status_all_same:
|
||||||
|
if last_default_ep_status not in (None, curShow.default_ep_status):
|
||||||
|
default_ep_status_all_same = False
|
||||||
|
else:
|
||||||
|
last_default_ep_status = curShow.default_ep_status
|
||||||
|
|
||||||
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 (None, curShow.is_anime):
|
if last_anime not in (None, curShow.is_anime):
|
||||||
@ -2927,6 +2936,7 @@ class Manage(Home, WebRoot):
|
|||||||
|
|
||||||
t.showList = toEdit
|
t.showList = toEdit
|
||||||
t.archive_firstmatch_value = last_archive_firstmatch if archive_firstmatch_all_same else None
|
t.archive_firstmatch_value = last_archive_firstmatch if archive_firstmatch_all_same else None
|
||||||
|
t.default_ep_status_value = last_default_ep_status if default_ep_status_all_same else None
|
||||||
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
|
||||||
t.flatten_folders_value = last_flatten_folders if flatten_folders_all_same else None
|
t.flatten_folders_value = last_flatten_folders if flatten_folders_all_same else None
|
||||||
@ -2940,9 +2950,8 @@ class Manage(Home, WebRoot):
|
|||||||
return t.respond()
|
return t.respond()
|
||||||
|
|
||||||
|
|
||||||
def massEditSubmit(self, archive_firstmatch=None, paused=None, anime=None, sports=None, scene=None,
|
def massEditSubmit(self, archive_firstmatch=None, paused=None, default_ep_status=None,
|
||||||
flatten_folders=None,
|
anime=None, sports=None, scene=None, flatten_folders=None, quality_preset=False,
|
||||||
quality_preset=False,
|
|
||||||
subtitles=None, air_by_date=None, anyQualities=[], bestQualities=[], toEdit=None, *args,
|
subtitles=None, air_by_date=None, anyQualities=[], bestQualities=[], toEdit=None, *args,
|
||||||
**kwargs):
|
**kwargs):
|
||||||
|
|
||||||
@ -2983,6 +2992,11 @@ class Manage(Home, WebRoot):
|
|||||||
new_paused = True if paused == 'enable' else False
|
new_paused = True if paused == 'enable' else False
|
||||||
new_paused = 'on' if new_paused else 'off'
|
new_paused = 'on' if new_paused else 'off'
|
||||||
|
|
||||||
|
if default_ep_status == 'keep':
|
||||||
|
new_default_ep_status = showObj.default_ep_status
|
||||||
|
else:
|
||||||
|
new_default_ep_status = default_ep_status
|
||||||
|
|
||||||
if anime == 'keep':
|
if anime == 'keep':
|
||||||
new_anime = showObj.anime
|
new_anime = showObj.anime
|
||||||
else:
|
else:
|
||||||
@ -3027,6 +3041,7 @@ class Manage(Home, WebRoot):
|
|||||||
|
|
||||||
curErrors += self.editShow(curShow, new_show_dir, anyQualities,
|
curErrors += self.editShow(curShow, new_show_dir, anyQualities,
|
||||||
bestQualities, exceptions_list,
|
bestQualities, exceptions_list,
|
||||||
|
defaultEpStatus=new_default_ep_status,
|
||||||
archive_firstmatch=new_archive_firstmatch,
|
archive_firstmatch=new_archive_firstmatch,
|
||||||
flatten_folders=new_flatten_folders,
|
flatten_folders=new_flatten_folders,
|
||||||
paused=new_paused, sports=new_sports,
|
paused=new_paused, sports=new_sports,
|
||||||
|
Loading…
Reference in New Issue
Block a user