mirror of
https://github.com/moparisthebest/SickRage
synced 2025-01-05 19:08:02 -05:00
Add removefiles to api show.delete
This commit is contained in:
parent
0365cc201b
commit
7bc422d199
@ -1,6 +1,6 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<title>API Builder</title>
|
<title>API Builder</title>
|
||||||
<script type="text/javascript" charset="utf-8">
|
<script type="text/javascript" charset="utf-8">
|
||||||
@ -22,7 +22,7 @@ sbRoot = "$sbRoot";
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var hide_empty_list=true;
|
var hide_empty_list=true;
|
||||||
var disable_empty_list=true;
|
var disable_empty_list=true;
|
||||||
|
|
||||||
addListGroup("api", "Command");
|
addListGroup("api", "Command");
|
||||||
@ -85,6 +85,10 @@ addOption("logs", "Info", "&min_level=info");
|
|||||||
addOption("logs", "Warning", "&min_level=warning");
|
addOption("logs", "Warning", "&min_level=warning");
|
||||||
addOption("logs", "Error", "&min_level=error");
|
addOption("logs", "Error", "&min_level=error");
|
||||||
|
|
||||||
|
addOption("show.delete", "Optional Param", "", 1);
|
||||||
|
addOption("show.delete", "removefiles", "&removefiles=0");
|
||||||
|
addOption("show.delete", "removefiles", "&removefiles=1");
|
||||||
|
|
||||||
addOption("postprocess", "Optional Param", "", 1);
|
addOption("postprocess", "Optional Param", "", 1);
|
||||||
addOption("postprocess", "C:\\PATH\\TO\\DIR", "&path=C:\\Temp");
|
addOption("postprocess", "C:\\PATH\\TO\\DIR", "&path=C:\\Temp");
|
||||||
addOption("postprocess", "return_data", "&return_data=1");
|
addOption("postprocess", "return_data", "&return_data=1");
|
||||||
|
@ -1952,7 +1952,7 @@ class CMD_Show(ApiCall):
|
|||||||
showDict["anime"] = showObj.anime
|
showDict["anime"] = showObj.anime
|
||||||
showDict["airs"] = str(showObj.airs).replace('am', ' AM').replace('pm', ' PM').replace(' ', ' ')
|
showDict["airs"] = str(showObj.airs).replace('am', ' AM').replace('pm', ' PM').replace(' ', ' ')
|
||||||
showDict["dvdorder"] = showObj.dvdorder
|
showDict["dvdorder"] = showObj.dvdorder
|
||||||
|
|
||||||
if showObj.rls_require_words:
|
if showObj.rls_require_words:
|
||||||
showDict["rls_require_words"] = showObj.rls_require_words.split(", ")
|
showDict["rls_require_words"] = showObj.rls_require_words.split(", ")
|
||||||
else:
|
else:
|
||||||
@ -1962,7 +1962,7 @@ class CMD_Show(ApiCall):
|
|||||||
showDict["rls_ignore_words"] = showObj.rls_ignore_words.split(", ")
|
showDict["rls_ignore_words"] = showObj.rls_ignore_words.split(", ")
|
||||||
else:
|
else:
|
||||||
showDict["rls_ignore_words"] = []
|
showDict["rls_ignore_words"] = []
|
||||||
|
|
||||||
showDict["scene"] = showObj.scene
|
showDict["scene"] = showObj.scene
|
||||||
showDict["archive_firstmatch"] = showObj.archive_firstmatch
|
showDict["archive_firstmatch"] = showObj.archive_firstmatch
|
||||||
|
|
||||||
@ -2286,6 +2286,7 @@ class CMD_ShowDelete(ApiCall):
|
|||||||
"optionalParameters": {
|
"optionalParameters": {
|
||||||
"tvdbid": {"desc": "thetvdb.com unique id of a show"},
|
"tvdbid": {"desc": "thetvdb.com unique id of a show"},
|
||||||
"tvrageid": {"desc": "tvrage.com unique id of a show"},
|
"tvrageid": {"desc": "tvrage.com unique id of a show"},
|
||||||
|
"removefiles":{"desc": "Deletes the files, there is no going back!"},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2293,6 +2294,7 @@ class CMD_ShowDelete(ApiCall):
|
|||||||
# required
|
# required
|
||||||
self.indexerid, args = self.check_params(args, kwargs, "indexerid", None, True, "int", [])
|
self.indexerid, args = self.check_params(args, kwargs, "indexerid", None, True, "int", [])
|
||||||
# optional
|
# optional
|
||||||
|
self.removefiles, args = self.check_params(args, kwargs, "removefiles", 0, False, "int", [0,1])
|
||||||
# super, missing, help
|
# super, missing, help
|
||||||
ApiCall.__init__(self, handler, args, kwargs)
|
ApiCall.__init__(self, handler, args, kwargs)
|
||||||
|
|
||||||
@ -2306,7 +2308,12 @@ class CMD_ShowDelete(ApiCall):
|
|||||||
showObj) or sickbeard.showQueueScheduler.action.isBeingUpdated(showObj): # @UndefinedVariable
|
showObj) or sickbeard.showQueueScheduler.action.isBeingUpdated(showObj): # @UndefinedVariable
|
||||||
return _responds(RESULT_FAILURE, msg="Show can not be deleted while being added or updated")
|
return _responds(RESULT_FAILURE, msg="Show can not be deleted while being added or updated")
|
||||||
|
|
||||||
showObj.deleteShow()
|
if sickbeard.USE_TRAKT and sickbeard.TRAKT_SYNC:
|
||||||
|
# remove show from trakt.tv library
|
||||||
|
sickbeard.traktCheckerScheduler.action.removeShowFromTraktLibrary(showObj)
|
||||||
|
|
||||||
|
showObj.deleteShow(bool(self.removefiles))
|
||||||
|
|
||||||
return _responds(RESULT_SUCCESS, msg=str(showObj.name) + " has been deleted")
|
return _responds(RESULT_SUCCESS, msg=str(showObj.name) + " has been deleted")
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user