X-Git-Url: http://git.veekun.com/zzz-spline-frontpage.git/blobdiff_plain/69e763a9763c70b88ccfbbd2ab126212b5754f63..9be4bb2b3da075385c748f33488d316ebcbdd9ff:/splinext/frontpage/controllers/frontpage.py?ds=sidebyside diff --git a/splinext/frontpage/controllers/frontpage.py b/splinext/frontpage/controllers/frontpage.py index 5aba8c5..04386fd 100644 --- a/splinext/frontpage/controllers/frontpage.py +++ b/splinext/frontpage/controllers/frontpage.py @@ -100,10 +100,10 @@ class FrontPageController(BaseController): else: merged_config['max_age'] = global_max_age or local_max_age - # Hooks should return a list of FrontPageUpdate-like objects, - # making this return value a list of lists + # XXX bleh updates_lol = run_hooks(hook_name, **merged_config) - updates += sum(updates_lol, []) + source_obj = updates_lol[0] + updates += source_obj.poll(merged_config['limit'], merged_config['max_age']) # Little optimization: maximum age effectively becomes the age of # the oldest thing that would still appear on the page, as anything @@ -112,7 +112,7 @@ class FrontPageController(BaseController): updates.sort(key=lambda obj: obj.time, reverse=True) updates = updates[:global_limit] - if updates: + if updates and len(updates) == global_limit: global_max_age = updates[-1].time c.updates = updates