Using hints on shared stories index.

This commit is contained in:
Samuel Clay 2016-11-09 11:28:53 -08:00
parent 5c11f12834
commit d7e2c5d3b0
2 changed files with 3 additions and 1 deletions

View file

@ -115,6 +115,7 @@ def load_social_stories(request, user_id, username=None):
.only('story_hash', 'starred_date', 'user_tags')
shared_stories = MSharedStory.objects(user_id=user.pk,
story_hash__in=story_hashes)\
.hint([('story_hash', 1)])\
.only('story_hash', 'shared_date', 'comments')
starred_stories = dict([(story.story_hash, dict(starred_date=story.starred_date,
user_tags=story.user_tags))
@ -252,6 +253,7 @@ def load_river_blurblog(request):
for story in starred_stories])
shared_stories = MSharedStory.objects(user_id=user.pk,
story_hash__in=story_hashes)\
.hint([('story_hash', 1)])\
.only('story_hash', 'shared_date', 'comments')
shared_stories = dict([(story.story_hash, dict(shared_date=story.shared_date,
comments=story.comments))

View file

@ -89,7 +89,7 @@ NEWSBLUR.Views.SocialPage = Backbone.View.extend({
if (search_story_guid && this.auto_advance_pages < this.MAX_AUTO_ADVANCED_PAGES) {
var found_story = _.detect(this.stories, function(story) {
var hash = story.model.get('story_feed_id') + ":" + story.story_guid;
return hash == search_story_guid;
return hash.indexOf(search_story_guid) >= 0;
});
if (found_story) {
var found_guid = found_story.story_guid;