mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-13 11:32:20 -05:00
Improved WebAPI interface:
sb.searchindexers searches ALL indexers sb.searchtvrage searches TVRage indexer sb.searchtvdb searches TVDB indexer
This commit is contained in:
parent
1cd91e6cc5
commit
1003e342ca
@ -833,11 +833,14 @@ class CMD_ComingEpisodes(ApiCall):
|
||||
class CMD_Episode(ApiCall):
|
||||
_help = {"desc": "display detailed info about an episode",
|
||||
"requiredParameters": {
|
||||
"indexerid or tvdbid or tvrageid": {"desc": "thetvdb.com or tvrage.com unique id of a show"},
|
||||
"indexerid": {"desc": "unique id of a show"},
|
||||
"season": {"desc": "the season number"},
|
||||
"episode": {"desc": "the episode number"}
|
||||
},
|
||||
"optionalParameters": {"full_path": {
|
||||
"optionalParameters": {
|
||||
"tvdbid": {"desc": "thetvdb.com unique id of a show"},
|
||||
"tvrageid": {"desc": "tvrage.com unique id of a show"},
|
||||
"full_path": {
|
||||
"desc": "show the full absolute path (if valid) instead of a relative path for the episode location"}
|
||||
}
|
||||
}
|
||||
@ -896,9 +899,13 @@ class CMD_Episode(ApiCall):
|
||||
class CMD_EpisodeSearch(ApiCall):
|
||||
_help = {"desc": "search for an episode. the response might take some time",
|
||||
"requiredParameters": {
|
||||
"indexerid or tvdbid or tvrageid": {"desc": "thetvdb.com or tvrage.com unique id of a show"},
|
||||
"indexerid": {"desc": "unique id of a show"},
|
||||
"season": {"desc": "the season number"},
|
||||
"episode": {"desc": "the episode number"}
|
||||
},
|
||||
"optionalParameters": {
|
||||
"tvdbid": {"desc": "thetvdb.com unique id of a show"},
|
||||
"tvrageid": {"desc": "tvrage.com unique id of a show"},
|
||||
}
|
||||
}
|
||||
|
||||
@ -943,13 +950,17 @@ class CMD_EpisodeSearch(ApiCall):
|
||||
class CMD_EpisodeSetStatus(ApiCall):
|
||||
_help = {"desc": "set status of an episode or season (when no ep is provided)",
|
||||
"requiredParameters": {
|
||||
"indexerid or tvdbid or tvrageid": {"desc": "thetvdb.com or tvrage.com unique id of a show"},
|
||||
"indexerid": {"desc": "unique id of a show"},
|
||||
"season": {"desc": "the season number"},
|
||||
"status": {"desc": "the status values: wanted, skipped, archived, ignored, failed"}
|
||||
},
|
||||
"optionalParameters": {"episode": {"desc": "the episode number"},
|
||||
"force": {"desc": "should we replace existing (downloaded) episodes or not"}
|
||||
"optionalParameters": {
|
||||
"episode": {"desc": "the episode number"},
|
||||
"force": {"desc": "should we replace existing (downloaded) episodes or not"},
|
||||
"tvdbid": {"desc": "thetvdb.com unique id of a show"},
|
||||
"tvrageid": {"desc": "tvrage.com unique id of a show"},
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
def __init__(self, handler, args, kwargs):
|
||||
@ -1054,9 +1065,13 @@ class CMD_EpisodeSetStatus(ApiCall):
|
||||
class CMD_SubtitleSearch(ApiCall):
|
||||
_help = {"desc": "search episode subtitles. the response might take some time",
|
||||
"requiredParameters": {
|
||||
"indexerid or tvdbid or tvrageid": {"desc": "thetvdb.com or tvrage.com unique id of a show"},
|
||||
"indexerid": {"desc": "unique id of a show"},
|
||||
"season": {"desc": "the season number"},
|
||||
"episode": {"desc": "the episode number"}
|
||||
},
|
||||
"optionalParameters": {
|
||||
"tvdbid": {"desc": "thetvdb.com unique id of a show"},
|
||||
"tvrageid": {"desc": "tvrage.com unique id of a show"},
|
||||
}
|
||||
}
|
||||
|
||||
@ -1107,7 +1122,9 @@ class CMD_SubtitleSearch(ApiCall):
|
||||
class CMD_Exceptions(ApiCall):
|
||||
_help = {"desc": "display scene exceptions for all or a given show",
|
||||
"optionalParameters": {
|
||||
"indexerid or tvdbid or tvrageid": {"desc": "thetvdb.com or tvrage.com unique id of a show"},
|
||||
"indexerid": {"desc": "unique id of a show"},
|
||||
"tvdbid": {"desc": "thetvdb.com unique id of a show"},
|
||||
"tvrageid": {"desc": "tvrage.com unique id of a show"},
|
||||
}
|
||||
}
|
||||
|
||||
@ -1605,9 +1622,9 @@ class CMD_SickBeardRestart(ApiCall):
|
||||
class CMD_SickBeardSearchIndexers(ApiCall):
|
||||
_help = {"desc": "search for show on the indexers with a given string and language",
|
||||
"optionalParameters": {"name": {"desc": "name of the show you want to search for"},
|
||||
"indexerid or tvdbid or tvrageid": {
|
||||
"desc": "thetvdb.com or tvrage.com unique id of a show"},
|
||||
"indexer": {"desc": "0=auto, 1=tvdb, 2=tvrage"},
|
||||
"indexerid": {"desc": "unique id of a show"},
|
||||
"tvdbid": {"desc": "thetvdb.com unique id of a show"},
|
||||
"tvrageid": {"desc": "tvrage.com unique id of a show"},
|
||||
"lang": {"desc": "the 2 letter abbreviation lang id"}
|
||||
}
|
||||
}
|
||||
@ -1691,6 +1708,35 @@ class CMD_SickBeardSearchIndexers(ApiCall):
|
||||
return _responds(RESULT_FAILURE, msg="Either a unique id or name is required!")
|
||||
|
||||
|
||||
class CMD_SickBeardSearchTVDB(CMD_SickBeardSearchIndexers):
|
||||
_help = {"desc": "search for show on theTVDB with a given string and language",
|
||||
"optionalParameters": {"name": {"desc": "name of the show you want to search for"},
|
||||
"tvdbid": {
|
||||
"desc": "thetvdb.com unique id of a show"},
|
||||
"lang": {"desc": "the 2 letter abbreviation lang id"}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def __init__(self, handler, args, kwargs):
|
||||
self.indexer = 1
|
||||
CMD_SickBeardSearchIndexers.__init__(self, handler, args, kwargs)
|
||||
|
||||
|
||||
class CMD_SickBeardSearchTVRAGE(CMD_SickBeardSearchIndexers):
|
||||
_help = {"desc": "search for show on TVRage with a given string and language",
|
||||
"optionalParameters": {"name": {"desc": "name of the show you want to search for"},
|
||||
"tvrageid": {
|
||||
"desc": "tvrage.com unique id of a show"},
|
||||
"lang": {"desc": "the 2 letter abbreviation lang id"}
|
||||
}
|
||||
}
|
||||
|
||||
def __init__(self, handler, args, kwargs):
|
||||
self.indexer = 2
|
||||
CMD_SickBeardSearchIndexers.__init__(self, handler, args, kwargs)
|
||||
|
||||
|
||||
class CMD_SickBeardSetDefaults(ApiCall):
|
||||
_help = {"desc": "set sickrage user defaults",
|
||||
"optionalParameters": {"initial": {"desc": "initial quality for the show"},
|
||||
@ -1787,8 +1833,12 @@ class CMD_SickBeardShutdown(ApiCall):
|
||||
class CMD_Show(ApiCall):
|
||||
_help = {"desc": "display information for a given show",
|
||||
"requiredParameters": {
|
||||
"indexerid or tvdbid or tvrageid": {"desc": "thetvdb.com or tvrage.com unique id of a show"},
|
||||
"indexerid": {"desc": "unique id of a show"},
|
||||
},
|
||||
"optionalParameters": {"tvdbid": {"desc": "thetvdb.com unique id of a show"},
|
||||
"tvrageid": {"desc": "tvrage.com unique id of a show"},
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
def __init__(self, handler, args, kwargs):
|
||||
@ -1806,8 +1856,7 @@ class CMD_Show(ApiCall):
|
||||
|
||||
showDict = {}
|
||||
showDict["season_list"] = CMD_ShowSeasonList(self.handler, (), {"indexerid": self.indexerid}).run()["data"]
|
||||
showDict["cache"] = CMD_ShowCache(self.handler, (), {"indexerid": self.indexerid}).run()[
|
||||
"data"]
|
||||
showDict["cache"] = CMD_ShowCache(self.handler, (), {"indexerid": self.indexerid}).run()["data"]
|
||||
|
||||
genreList = []
|
||||
if showObj.genre:
|
||||
@ -1835,11 +1884,13 @@ class CMD_Show(ApiCall):
|
||||
showDict["flatten_folders"] = showObj.flatten_folders
|
||||
showDict["sports"] = showObj.sports
|
||||
showDict["anime"] = showObj.anime
|
||||
# clean up tvdb horrible airs field
|
||||
showDict["airs"] = str(showObj.airs).replace('am', ' AM').replace('pm', ' PM').replace(' ', ' ')
|
||||
showDict["indexerid"] = self.indexerid
|
||||
|
||||
showDict["indexerid"] = showObj.indexerid
|
||||
showDict["tvdbid"] = helpers.mapIndexersToShow(showObj)[1]
|
||||
showDict["tvrage_id"] = helpers.mapIndexersToShow(showObj)[2]
|
||||
showDict["tvrage_name"] = showObj.name
|
||||
|
||||
showDict["network"] = showObj.network
|
||||
if not showDict["network"]:
|
||||
showDict["network"] = ""
|
||||
@ -2622,7 +2673,7 @@ class CMD_Shows(ApiCall):
|
||||
"anime": curShow.anime,
|
||||
"indexerid": curShow.indexerid,
|
||||
"tvdbid": helpers.mapIndexersToShow(curShow)[1],
|
||||
"tvrageid": helpers.mapIndexersToShow(curShow)[2],
|
||||
"tvrage_id": helpers.mapIndexersToShow(curShow)[2],
|
||||
"tvrage_name": curShow.name,
|
||||
"network": curShow.network,
|
||||
"show_name": curShow.name,
|
||||
@ -2707,8 +2758,8 @@ _functionMaper = {"help": CMD_Help,
|
||||
"sb.ping": CMD_SickBeardPing,
|
||||
"sb.restart": CMD_SickBeardRestart,
|
||||
"sb.searchindexers": CMD_SickBeardSearchIndexers,
|
||||
"sb.searchtvdb": CMD_SickBeardSearchIndexers,
|
||||
"sb.searchtvrage": CMD_SickBeardSearchIndexers,
|
||||
"sb.searchtvdb": CMD_SickBeardSearchTVDB,
|
||||
"sb.searchtvrage": CMD_SickBeardSearchTVRAGE,
|
||||
"sb.setdefaults": CMD_SickBeardSetDefaults,
|
||||
"sb.shutdown": CMD_SickBeardShutdown,
|
||||
"show": CMD_Show,
|
||||
|
Loading…
Reference in New Issue
Block a user