diff options
Diffstat (limited to 'cgi/api.py')
-rw-r--r-- | cgi/api.py | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -93,18 +93,19 @@ def api_process(self, path_split): data_limit = formdata.get('limit') data_time = formdata.get('time', 0) - limit = 30 - if data_limit: try: limit = int(data_limit) except ValueError: raise APIError("Limit must be numeric") - if limit > 50: - raise APIError("Maximum limit is 50") + if limit > 30: + raise APIError("Maximum limit is 30") + + threads = getLastAge(0, limit) + threads += getLastAge(1, limit) + threads = sorted(threads, key=lambda b:b['bumped'], reverse=True) - threads = getLastAge(limit) if threads[0]['bumped'] > int(data_time): values['threads'] = threads else: |