diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-12-21 17:09:01 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-12-21 17:09:01 +0100 |
commit | c22d2aadb41b6014516b31c978634c4979d9a43c (patch) | |
tree | e0d1284ef0e591316f083abfccf9404fd95557b3 /module/Api.py | |
parent | removed pie charts (diff) | |
download | pyload-c22d2aadb41b6014516b31c978634c4979d9a43c.tar.xz |
added tags attribute to packages
Diffstat (limited to 'module/Api.py')
-rw-r--r-- | module/Api.py | 39 |
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 ############################# |