Remvoing unused everything_unread param from river stories.

This commit is contained in:
Samuel Clay 2013-05-09 16:40:06 -07:00
parent cc5d87f795
commit 0483273840
4 changed files with 7 additions and 10 deletions

View file

@ -170,7 +170,7 @@ class UserSubscription(models.Model):
feed_ids = [feed_ids]
ranked_stories_keys = 'zU:%s:feeds' % (user_id)
unread_ranked_stories_keys = 'zfU:%s:feeds' % (user_id)
unread_ranked_stories_keys = 'zhU:%s:feeds' % (user_id)
unread_story_hashes = cache.get(unread_ranked_stories_keys)
if offset and r.exists(ranked_stories_keys) and unread_story_hashes:
story_hashes = range_func(ranked_stories_keys, offset, limit)
@ -194,7 +194,7 @@ class UserSubscription(models.Model):
r.zadd(ranked_stories_keys, **dict(story_hashes))
story_hashes = range_func(ranked_stories_keys, offset, limit)
r.expire(ranked_stories_keys, 24*60*60)
r.expire(ranked_stories_keys, 60*60)
cache.set(unread_ranked_stories_keys, unread_feed_story_hashes, 24*60*60)
return story_hashes, unread_feed_story_hashes

View file

@ -934,7 +934,6 @@ def mark_social_stories_as_read(request):
code = -1
errors.append("Already read story: %s" % e)
except MSocialSubscription.DoesNotExist:
print "Unsub: %s" % story_ids
MSocialSubscription.mark_unsub_story_ids_as_read(request.user.pk, social_user_id,
story_ids, feed_id,
request=request)

View file

@ -792,7 +792,7 @@ class MSocialSubscription(mongo.Document):
}
def get_stories(self, offset=0, limit=6, order='newest', read_filter='all',
withscores=False, everything_unread=False, hashes_only=False):
withscores=False, hashes_only=False):
r = redis.Redis(connection_pool=settings.REDIS_STORY_HASH_POOL)
ignore_user_stories = False
@ -837,7 +837,7 @@ class MSocialSubscription(mongo.Document):
return story_ids
@classmethod
def feed_stories(cls, user_id, social_user_ids, offset=0, limit=6, order='newest', read_filter='all', relative_user_id=None, everything_unread=False):
def feed_stories(cls, user_id, social_user_ids, offset=0, limit=6, order='newest', read_filter='all', relative_user_id=None):
r = redis.Redis(connection_pool=settings.REDIS_STORY_HASH_POOL)
if not relative_user_id:
@ -852,7 +852,7 @@ class MSocialSubscription(mongo.Document):
social_user_ids = [social_user_ids]
ranked_stories_keys = 'zU:%s:social' % (user_id)
read_ranked_stories_keys = 'zfU:%s:social' % (user_id)
read_ranked_stories_keys = 'zhU:%s:social' % (user_id)
if offset and r.exists(ranked_stories_keys) and r.exists(read_ranked_stories_keys):
story_hashes = range_func(ranked_stories_keys, offset, limit, withscores=True)
read_story_hashes = range_func(read_ranked_stories_keys, 0, -1)
@ -869,7 +869,7 @@ class MSocialSubscription(mongo.Document):
us = cls.objects.get(user_id=relative_user_id, subscription_user_id=social_user_id)
story_hashes = us.get_stories(offset=0, limit=100,
order=order, read_filter=read_filter,
withscores=True, everything_unread=everything_unread)
withscores=True)
if story_hashes:
r.zadd(ranked_stories_keys, **dict(story_hashes))

View file

@ -197,8 +197,7 @@ def load_river_blurblog(request):
user.pk, social_user_ids,
offset=offset, limit=limit,
order=order, read_filter=read_filter,
relative_user_id=relative_user_id,
everything_unread=global_feed)
relative_user_id=relative_user_id)
mstories = MStory.find_by_story_hashes(story_hashes)
story_hashes_to_dates = dict(zip(story_hashes, story_dates))
def sort_stories_by_hash(a, b):
@ -502,7 +501,6 @@ def mark_story_as_shared(request):
"user_id": request.user.pk,
"comments": comments,
"has_comments": bool(comments),
"story_db_id": story.id,
}
shared_story = MSharedStory.objects.create(**story_db)
if source_user_id: