mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-04 02:13:38 +00:00
Fix API save show paused state and API exception raised when no indexer results.
Fix API show pause not saved. Fix API exception when search doesn't find any results from a indexer (Web API).
This commit is contained in:
parent
54a877d3e3
commit
197340951c
1 changed files with 6 additions and 6 deletions
|
@ -2414,14 +2414,12 @@ class CMD_SickGearSearchIndexers(ApiCall):
|
||||||
lINDEXER_API_PARMS['custom_ui'] = classes.AllShowsNoFilterListUI
|
lINDEXER_API_PARMS['custom_ui'] = classes.AllShowsNoFilterListUI
|
||||||
t = sickbeard.indexerApi(i).indexer(**lINDEXER_API_PARMS)
|
t = sickbeard.indexerApi(i).indexer(**lINDEXER_API_PARMS)
|
||||||
|
|
||||||
apiData = None
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
apiData = t[str(self.name).encode(), False]
|
apiData = t[str(self.name).encode(), False]
|
||||||
except (StandardError, Exception):
|
except (StandardError, Exception):
|
||||||
pass
|
continue
|
||||||
|
|
||||||
for curSeries in apiData:
|
for curSeries in (apiData or []):
|
||||||
s = {"indexerid": int(curSeries['id']),
|
s = {"indexerid": int(curSeries['id']),
|
||||||
"name": curSeries['seriesname'],
|
"name": curSeries['seriesname'],
|
||||||
"first_aired": curSeries['firstaired'],
|
"first_aired": curSeries['firstaired'],
|
||||||
|
@ -3658,10 +3656,12 @@ class CMD_SickGearShowPause(ApiCall):
|
||||||
return _responds(RESULT_FAILURE, msg="Show not found")
|
return _responds(RESULT_FAILURE, msg="Show not found")
|
||||||
|
|
||||||
if self.pause:
|
if self.pause:
|
||||||
showObj.paused = 1
|
showObj.paused = True
|
||||||
|
showObj.saveToDB()
|
||||||
return _responds(RESULT_SUCCESS, msg=str(showObj.name) + " has been paused")
|
return _responds(RESULT_SUCCESS, msg=str(showObj.name) + " has been paused")
|
||||||
else:
|
else:
|
||||||
showObj.paused = 0
|
showObj.paused = False
|
||||||
|
showObj.saveToDB()
|
||||||
return _responds(RESULT_SUCCESS, msg=str(showObj.name) + " has been unpaused")
|
return _responds(RESULT_SUCCESS, msg=str(showObj.name) + " has been unpaused")
|
||||||
|
|
||||||
return _responds(RESULT_FAILURE, msg=str(showObj.name) + " was unable to be paused")
|
return _responds(RESULT_FAILURE, msg=str(showObj.name) + " was unable to be paused")
|
||||||
|
|
Loading…
Reference in a new issue