summaryrefslogtreecommitdiffstats
path: root/module/remote
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-10-09 22:09:16 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-10-09 22:09:16 +0200
commit49c4088ceb02da735d549014aaa9cba8c729ba54 (patch)
tree9ae70f02f4c548b7e7d2409eef89505cbd1924db /module/remote
parentadded nodejs as usuable js engine (diff)
downloadpyload-49c4088ceb02da735d549014aaa9cba8c729ba54.tar.xz
modified Api: filter downloads by state
Diffstat (limited to 'module/remote')
-rw-r--r--module/remote/create_ttypes.py2
-rw-r--r--module/remote/pyload.thrift8
-rw-r--r--module/remote/ttypes.py67
3 files changed, 39 insertions, 38 deletions
diff --git a/module/remote/create_ttypes.py b/module/remote/create_ttypes.py
index ec4f07a7d..a9a93bde7 100644
--- a/module/remote/create_ttypes.py
+++ b/module/remote/create_ttypes.py
@@ -52,7 +52,7 @@ class BaseObject(object):
name = enum.__name__
f.write("class %s:\n" % name)
- for attr in dir(enum):
+ for attr in sorted(dir(enum), key=lambda x: getattr(enum, x)):
if attr.startswith("_") or attr in ("read", "write"): continue
f.write("\t%s = %s\n" % (attr, getattr(enum, attr)))
diff --git a/module/remote/pyload.thrift b/module/remote/pyload.thrift
index 3b0f74cbc..ea2aa7347 100644
--- a/module/remote/pyload.thrift
+++ b/module/remote/pyload.thrift
@@ -34,7 +34,7 @@ enum DownloadStatus {
// Download states, combination of several downloadstatuses
// defined in Filedatabase
-enum DownloadStates {
+enum DownloadState {
All,
Finished,
Unfinished,
@@ -406,15 +406,15 @@ service Pyload {
void deleteCollLink(1: string url),
////////////////////////////
- // File Information retrival
+ // File Information retrieval
////////////////////////////
TreeCollection getAllFiles(),
- TreeCollection getAllUnfinishedFiles(),
+ TreeCollection getFilteredFiles(1: DownloadState state),
// pid -1 for root, full=False only delivers first level in tree
TreeCollection getFileTree(1: PackageID pid, 2: bool full),
- TreeCollection getUnfinishedFileTree(1: PackageID pid, 2: bool full),
+ TreeCollection getFilteredFileTree(1: PackageID pid, 2: bool full, 3: DownloadState state),
// same as above with full=False
TreeCollection getPackageContent(1: PackageID pid),
diff --git a/module/remote/ttypes.py b/module/remote/ttypes.py
index 70105275d..ecff45170 100644
--- a/module/remote/ttypes.py
+++ b/module/remote/ttypes.py
@@ -6,77 +6,78 @@
class BaseObject(object):
__slots__ = []
-class DownloadStates:
- Failed = 2
- Finished = 0
- Unfinished = 1
- Unmanaged = 3
+class DownloadState:
+ All = 0
+ Finished = 1
+ Unfinished = 2
+ Failed = 3
+ Unmanaged = 4
class DownloadStatus:
- Aborted = 12
- Custom = 15
- Decrypting = 13
- Downloading = 10
- Failed = 7
- Finished = 5
NA = 0
Offline = 1
Online = 2
- Paused = 4
- Processing = 14
Queued = 3
+ Paused = 4
+ Finished = 5
Skipped = 6
+ Failed = 7
Starting = 8
+ Waiting = 9
+ Downloading = 10
TempOffline = 11
+ Aborted = 12
+ Decrypting = 13
+ Processing = 14
+ Custom = 15
Unknown = 16
- Waiting = 9
class FileStatus:
- Missing = 1
Ok = 0
+ Missing = 1
Remote = 2
class Input:
- Bool = 4
- Click = 5
- List = 8
- Multiple = 7
NA = 0
+ Text = 1
+ Textbox = 2
Password = 3
+ Bool = 4
+ Click = 5
Select = 6
+ Multiple = 7
+ List = 8
Table = 9
- Text = 1
- Textbox = 2
class MediaType:
All = 0
- Archive = 32
+ Other = 1
Audio = 2
- Document = 16
Image = 4
- Other = 1
Video = 8
+ Document = 16
+ Archive = 32
class Output:
All = 0
- Captcha = 2
Notification = 1
+ Captcha = 2
Query = 4
class PackageStatus:
- Folder = 2
Ok = 0
Paused = 1
+ Folder = 2
Remote = 3
class Permission:
- Accounts = 16
- Add = 1
All = 0
+ Add = 1
Delete = 2
+ Modify = 4
Download = 8
+ Accounts = 16
Interaction = 32
- Modify = 4
Plugins = 64
class Role:
@@ -393,8 +394,6 @@ class Iface(object):
pass
def getAllInfo(self):
pass
- def getAllUnfinishedFiles(self):
- pass
def getAllUserData(self):
pass
def getCollector(self):
@@ -407,6 +406,10 @@ class Iface(object):
pass
def getFileTree(self, pid, full):
pass
+ def getFilteredFileTree(self, pid, full, state):
+ pass
+ def getFilteredFiles(self, state):
+ pass
def getGlobalPlugins(self):
pass
def getInfoByPlugin(self, plugin):
@@ -425,8 +428,6 @@ class Iface(object):
pass
def getServerVersion(self):
pass
- def getUnfinishedFileTree(self, pid, full):
- pass
def getUserData(self):
pass
def getUserPlugins(self):