aboutsummaryrefslogtreecommitdiff
path: root/src/web/views/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/web/views/views.py')
-rw-r--r--src/web/views/views.py7
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) \
bgstack15