summaryrefslogtreecommitdiffstats
path: root/module/Api.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-12-21 17:09:01 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-12-21 17:09:01 +0100
commitc22d2aadb41b6014516b31c978634c4979d9a43c (patch)
treee0d1284ef0e591316f083abfccf9404fd95557b3 /module/Api.py
parentremoved pie charts (diff)
downloadpyload-c22d2aadb41b6014516b31c978634c4979d9a43c.tar.xz
added tags attribute to packages
Diffstat (limited to 'module/Api.py')
-rw-r--r--module/Api.py39
1 files changed, 20 insertions, 19 deletions
diff --git a/module/Api.py b/module/Api.py
index d1ccf43c0..0b777a659 100644
--- a/module/Api.py
+++ b/module/Api.py
@@ -696,6 +696,10 @@ class Api(Iface):
def findFiles(self, pattern):
pass
+ @RequirePerm(Permission.All)
+ def findPackages(self, tags):
+ pass
+
#############################
# Modify Downloads
#############################
@@ -751,8 +755,22 @@ class Api(Iface):
#############################
@RequirePerm(Permission.Modify)
- def setPackagePaused(self, pid, paused):
- pass
+ def updatePackage(self, pack):
+ """Allows to modify several package attributes.
+
+ :param pid: package id
+ :param data: :class:`PackageInfo`
+ """
+ pid = pack.pid
+ p = self.core.files.getPackage(pid)
+ if not p: raise PackageDoesNotExists(pid)
+
+ for key, value in data.iteritems():
+ if key == "id": continue
+ setattr(p, key, value)
+
+ p.sync()
+ self.core.files.save()
@RequirePerm(Permission.Modify)
def setPackageFolder(self, pid, path):
@@ -803,23 +821,6 @@ class Api(Iface):
"""
self.core.files.orderFiles(fids, pid, position)
- @RequirePerm(Permission.Modify)
- def setPackageData(self, pid, data):
- """Allows to modify several package attributes.
-
- :param pid: package id
- :param data: dict that maps attribute to desired value
- """
- p = self.core.files.getPackage(pid)
- if not p: raise PackageDoesNotExists(pid)
-
- for key, value in data.iteritems():
- if key == "id": continue
- setattr(p, key, value)
-
- p.sync()
- self.core.files.save()
-
#############################
# User Interaction
#############################