mirror of
https://github.com/SickGear/SickGear.git
synced 2025-03-15 09:07:43 +00:00
Add force episode recent search to API.
This commit is contained in:
parent
00da1ce3a4
commit
5a7822db13
2 changed files with 21 additions and 1 deletions
|
@ -23,6 +23,7 @@
|
||||||
* Add singledispatch 3.4.0.3
|
* Add singledispatch 3.4.0.3
|
||||||
* Change refactor email notifier
|
* Change refactor email notifier
|
||||||
* Change emails to Unicode aware
|
* Change emails to Unicode aware
|
||||||
|
* Add force episode recent search to API
|
||||||
|
|
||||||
|
|
||||||
### 0.11.5 (2016-02-01 19:40:00 UTC)
|
### 0.11.5 (2016-02-01 19:40:00 UTC)
|
||||||
|
|
|
@ -728,7 +728,7 @@ class CMD_ComingEpisodes(ApiCall):
|
||||||
|
|
||||||
# make a dict out of the sql results
|
# make a dict out of the sql results
|
||||||
sql_results = [dict(row) for row in sql_results]
|
sql_results = [dict(row) for row in sql_results]
|
||||||
|
|
||||||
# multi dimension sort
|
# multi dimension sort
|
||||||
sorts = {
|
sorts = {
|
||||||
'date': (lambda a, b: cmp(
|
'date': (lambda a, b: cmp(
|
||||||
|
@ -1465,6 +1465,24 @@ class CMD_SickBeardDeleteRootDir(ApiCall):
|
||||||
return _responds(RESULT_SUCCESS, _getRootDirs(), msg="Root directory deleted")
|
return _responds(RESULT_SUCCESS, _getRootDirs(), msg="Root directory deleted")
|
||||||
|
|
||||||
|
|
||||||
|
class CMD_SickBeardForceSearch(ApiCall):
|
||||||
|
_help = {'desc': 'force the episode recent search early'}
|
||||||
|
|
||||||
|
def __init__(self, handler, args, kwargs):
|
||||||
|
# required
|
||||||
|
# optional
|
||||||
|
# super, missing, help
|
||||||
|
ApiCall.__init__(self, handler, args, kwargs)
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
""" force the episode search early """
|
||||||
|
# Searching all providers for any needed episodes
|
||||||
|
result = sickbeard.recentSearchScheduler.forceRun()
|
||||||
|
if result:
|
||||||
|
return _responds(RESULT_SUCCESS, msg='Episode recent search successfully forced')
|
||||||
|
return _responds(RESULT_FAILURE, msg='Can not force the episode recent search because it\'s already active')
|
||||||
|
|
||||||
|
|
||||||
class CMD_SickBeardGetDefaults(ApiCall):
|
class CMD_SickBeardGetDefaults(ApiCall):
|
||||||
_help = {"desc": "get sickbeard user defaults"}
|
_help = {"desc": "get sickbeard user defaults"}
|
||||||
|
|
||||||
|
@ -2651,6 +2669,7 @@ _functionMaper = {"help": CMD_Help,
|
||||||
"sb.addrootdir": CMD_SickBeardAddRootDir,
|
"sb.addrootdir": CMD_SickBeardAddRootDir,
|
||||||
"sb.checkscheduler": CMD_SickBeardCheckScheduler,
|
"sb.checkscheduler": CMD_SickBeardCheckScheduler,
|
||||||
"sb.deleterootdir": CMD_SickBeardDeleteRootDir,
|
"sb.deleterootdir": CMD_SickBeardDeleteRootDir,
|
||||||
|
"sb.forcesearch": CMD_SickBeardForceSearch,
|
||||||
"sb.getdefaults": CMD_SickBeardGetDefaults,
|
"sb.getdefaults": CMD_SickBeardGetDefaults,
|
||||||
"sb.getmessages": CMD_SickBeardGetMessages,
|
"sb.getmessages": CMD_SickBeardGetMessages,
|
||||||
"sb.getrootdirs": CMD_SickBeardGetRootDirs,
|
"sb.getrootdirs": CMD_SickBeardGetRootDirs,
|
||||||
|
|
Loading…
Reference in a new issue