Skip to content

Commit cfceea8

Browse files
neox387mmarquezs
authored andcommitted
add set_enabled and force_download
1 parent ede4851 commit cfceea8

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

myjdapi/myjdapi.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -347,18 +347,8 @@ def set_priority(self, priority, link_ids, package_ids):
347347
resp = self.device.action(self.url + "/setPriority", params)
348348
return resp
349349

350-
def set_enabled(self, params):
351-
"""
352-
353-
My guess is that it Enables/Disables a download, but i haven't got it working.
354-
355-
:param params: List with a boolean (enable/disable download), my guess
356-
the parameters are package uuid, download uuid. Ex:
357-
[False,2453556,2334455].
358-
:type: List
359-
:rtype:
360-
361-
"""
350+
def set_enabled(self, enabled, link_ids=[], package_ids=[]):
351+
params = [enabled, link_ids, package_ids]
362352
resp = self.device.action(self.url + "/setEnabled", params)
363353
return resp
364354

@@ -606,6 +596,16 @@ def cleanup(self,
606596
resp = self.device.action(self.url + "/cleanup", params)
607597
return resp
608598

599+
def set_enabled(self, enabled, link_ids=[], package_ids=[]):
600+
params = [enabled, link_ids, package_ids]
601+
resp = self.device.action(self.url + "/setEnabled", params)
602+
return resp
603+
604+
def force_download(self, link_ids=[], package_ids=[]):
605+
params = [link_ids, package_ids]
606+
resp = self.device.action(self.url + "/forceDownload", params)
607+
return resp
608+
609609

610610
class Jddevice:
611611
"""

0 commit comments

Comments
 (0)