(id)
| 85 | @route("/json/package/<id:int>") |
| 86 | @login_required('LIST') |
| 87 | def package(id): |
| 88 | try: |
| 89 | data = toDict(PYLOAD.getPackageData(id)) |
| 90 | data["links"] = [toDict(x) for x in data["links"]] |
| 91 | |
| 92 | for pyfile in data["links"]: |
| 93 | if pyfile["status"] == 0: |
| 94 | pyfile["icon"] = "status_finished.png" |
| 95 | elif pyfile["status"] in (2, 3): |
| 96 | pyfile["icon"] = "status_queue.png" |
| 97 | elif pyfile["status"] in (9, 1): |
| 98 | pyfile["icon"] = "status_offline.png" |
| 99 | elif pyfile["status"] == 5: |
| 100 | pyfile["icon"] = "status_waiting.png" |
| 101 | elif pyfile["status"] == 8: |
| 102 | pyfile["icon"] = "status_failed.png" |
| 103 | elif pyfile["status"] == 4: |
| 104 | pyfile["icon"] = "arrow_right.png" |
| 105 | elif pyfile["status"] in (11, 13): |
| 106 | pyfile["icon"] = "status_proc.png" |
| 107 | else: |
| 108 | pyfile["icon"] = "status_downloading.png" |
| 109 | |
| 110 | tmp = data["links"] |
| 111 | tmp.sort(key=get_sort_key) |
| 112 | data["links"] = tmp |
| 113 | return data |
| 114 | |
| 115 | except: |
| 116 | print_exc() |
| 117 | return HTTPError() |
| 118 | |
| 119 | |
| 120 | @route("/json/package_order/:ids") |
nothing calls this directly
no test coverage detected