diff options
author | François Schmidts <francois.schmidts@gmail.com> | 2016-01-29 20:28:10 +0100 |
---|---|---|
committer | François Schmidts <francois.schmidts@gmail.com> | 2016-01-29 20:28:10 +0100 |
commit | 4c5415754593986d1540820d13dfa34a34ffeed6 (patch) | |
tree | d8a488ae6525155b677b0094aef81f87154a66a3 /src/web/views | |
parent | cleaning warnings (diff) | |
download | newspipe-4c5415754593986d1540820d13dfa34a34ffeed6.tar.gz newspipe-4c5415754593986d1540820d13dfa34a34ffeed6.tar.bz2 newspipe-4c5415754593986d1540820d13dfa34a34ffeed6.zip |
impact on menus when loading article
Diffstat (limited to 'src/web/views')
-rw-r--r-- | src/web/views/views.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/web/views/views.py b/src/web/views/views.py index 3e7bf80a..1ee3d06d 100644 --- a/src/web/views/views.py +++ b/src/web/views/views.py @@ -286,7 +286,7 @@ def _get_filters(in_dict): def _articles_to_json(articles, fd_hash=None): return jsonify(**{'articles': [{'title': art.title, 'liked': art.like, - 'read': art.readed, 'article_id': art.id, + 'read': art.readed, 'article_id': art.id, 'selected': False, 'feed_id': art.feed_id, 'category_id': art.category_id or 0, 'feed_title': fd_hash[art.feed_id]['title'] if fd_hash else None, 'icon_url': fd_hash[art.feed_id]['icon_url'] if fd_hash else None, @@ -309,7 +309,10 @@ def get_middle_panel(): @app.route('/getart/<int:article_id>') @login_required def get_article(article_id): - article = ArticleController(g.user.id).get(id=article_id).dump() + contr = ArticleController(g.user.id) + article = contr.get(id=article_id).dump() + if not article['readed']: + contr.update({'id': article_id}, {'readed': True}) article['category_id'] = article['category_id'] or 0 feed = FeedController(g.user.id).get(id=article['feed_id']) article['icon_url'] = url_for('icon.icon', url=feed.icon_url) \ |