aboutsummaryrefslogtreecommitdiff
path: root/src/web/views
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2016-01-30 01:44:13 +0100
committerFrançois Schmidts <francois.schmidts@gmail.com>2016-01-30 01:44:13 +0100
commitf334fb4b355d90cbf0b8d9e658a87ebeec7fbe90 (patch)
tree9070ef12da288a3138fb261320e522b47c3803f5 /src/web/views
parentdisplaying date on middle panel (diff)
downloadnewspipe-f334fb4b355d90cbf0b8d9e658a87ebeec7fbe90.tar.gz
newspipe-f334fb4b355d90cbf0b8d9e658a87ebeec7fbe90.tar.bz2
newspipe-f334fb4b355d90cbf0b8d9e658a87ebeec7fbe90.zip
wip redoing feed panel
Diffstat (limited to 'src/web/views')
-rw-r--r--src/web/views/views.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/web/views/views.py b/src/web/views/views.py
index 49554cb3..f8549e93 100644
--- a/src/web/views/views.py
+++ b/src/web/views/views.py
@@ -230,6 +230,7 @@ def signup():
return render_template('signup.html', form=form)
+from calendar import timegm
from flask import jsonify
@@ -250,8 +251,12 @@ def get_menu():
categories[cat_id]['feeds'] = []
feeds = {feed.id: feed.dump() for feed in FeedController(g.user.id).read()}
for feed_id, feed in feeds.items():
+ feed['created_stamp'] = timegm(feed['created_date'].timetuple()) * 1000
+ feed['last_stamp'] = timegm(feed['last_retrieved'].timetuple()) * 1000
feed['category_id'] = feed['category_id'] or 0
feed['unread'] = unread.get(feed['id'], 0)
+ if not feed['filters']:
+ feed['filters'] = []
if feed.get('icon_url'):
feed['icon_url'] = url_for('icon.icon', url=feed['icon_url'])
categories[feed['category_id']]['unread'] += feed['unread']
@@ -284,17 +289,13 @@ def _get_filters(in_dict):
return filters
-import calendar
-
-
def _articles_to_json(articles, fd_hash=None):
return jsonify(**{'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,
'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,
- 'date': art.date,
- 'timestamp': calendar.timegm(art.date.timetuple()) * 1000}
+ 'date': art.date, 'timestamp': timegm(art.date.timetuple()) * 1000}
for art in articles.limit(1000)]})
bgstack15