mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Trying to add feed statistics back. Only calculating them when requested.
This commit is contained in:
parent
7b4060a384
commit
40e4af7a8d
4 changed files with 5 additions and 8 deletions
|
@ -311,7 +311,8 @@ def load_single_feed(request):
|
|||
feed_tags=feed_tags,
|
||||
feed_authors=feed_authors,
|
||||
classifiers=classifiers,
|
||||
last_update=last_update)
|
||||
last_update=last_update,
|
||||
feed_id=feed.pk)
|
||||
return data
|
||||
|
||||
def load_feed_page(request):
|
||||
|
|
|
@ -259,7 +259,7 @@ class Feed(models.Model):
|
|||
}
|
||||
"""
|
||||
dates = {}
|
||||
res = MStory.objects(story_feed_id=self.pk).map_reduce(map_f, reduce_f)
|
||||
res = MStory.objects(story_feed_id=self.pk).map_reduce(map_f, reduce_f, keep_temp=False)
|
||||
for r in res:
|
||||
dates[r.key] = r.value
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ def load_feed_statistics(request):
|
|||
stats = dict()
|
||||
feed_id = request.GET['feed_id']
|
||||
feed = get_object_or_404(Feed, pk=feed_id)
|
||||
feed.save_feed_story_history_statistics()
|
||||
|
||||
# Dates of last and next update
|
||||
stats['last_update'] = relative_timesince(feed.last_update)
|
||||
|
|
|
@ -1145,12 +1145,7 @@
|
|||
}
|
||||
var stories = data.stories;
|
||||
var tags = data.tags;
|
||||
var feed_id = this.active_feed;
|
||||
|
||||
for (var s in stories) {
|
||||
feed_id = stories[s].story_feed_id;
|
||||
break;
|
||||
}
|
||||
var feed_id = data.feed_id;
|
||||
|
||||
if (this.active_feed == feed_id) {
|
||||
// NEWSBLUR.log(['post_open_feed', data.stories, this.flags]);
|
||||
|
|
Loading…
Add table
Reference in a new issue