aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2016-04-18 14:28:10 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2016-04-18 14:28:10 +0200
commit771a6610fd0653c8f5248e19b9ca70e5fa8c9126 (patch)
tree7d22b538468992e2d4a0ee5c3b2ed7d72fb4133c /src
parentfixing relative date translations (diff)
downloadnewspipe-771a6610fd0653c8f5248e19b9ca70e5fa8c9126.tar.gz
newspipe-771a6610fd0653c8f5248e19b9ca70e5fa8c9126.tar.bz2
newspipe-771a6610fd0653c8f5248e19b9ca70e5fa8c9126.zip
models.Article is not imported here...
Diffstat (limited to 'src')
-rw-r--r--src/web/views/home.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/web/views/home.py b/src/web/views/home.py
index dfda381a..f53299dc 100644
--- a/src/web/views/home.py
+++ b/src/web/views/home.py
@@ -97,6 +97,11 @@ def _get_filters(in_dict):
@jsonify
def _articles_to_json(articles, fd_hash=None):
now, locale = datetime.now(), get_locale()
+ fd_hash = {feed.id: {'title': feed.title,
+ 'icon_url': url_for('icon.icon', url=feed.icon_url)
+ if feed.icon_url else None}
+ for feed in FeedController(current_user.id).read()}
+
return {'articles': [{'title': art.title, 'liked': art.like,
'read': art.readed, 'article_id': art.id, 'selected': False,
'feed_id': art.feed_id, 'category_id': art.category_id or 0,
@@ -115,12 +120,8 @@ def _articles_to_json(articles, fd_hash=None):
def get_middle_panel():
filters = _get_filters(request.args)
art_contr = ArticleController(current_user.id)
- fd_hash = {feed.id: {'title': feed.title,
- 'icon_url': url_for('icon.icon', url=feed.icon_url)
- if feed.icon_url else None}
- for feed in FeedController(current_user.id).read()}
- articles = art_contr.read(**filters).order_by(Article.date.desc())
- return _articles_to_json(articles, fd_hash)
+ articles = art_contr.read_light(**filters)
+ return _articles_to_json(articles)
@current_app.route('/getart/<int:article_id>')
bgstack15