mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
No future dating mark read dates due to stories being future dated.
This commit is contained in:
parent
d66537bd0f
commit
5c18498d99
2 changed files with 6 additions and 2 deletions
|
@ -624,7 +624,9 @@ class UserSubscription(models.Model):
|
|||
if cutoff_date:
|
||||
cutoff_date = cutoff_date + datetime.timedelta(seconds=1)
|
||||
else:
|
||||
latest_story = MStory.objects(story_feed_id=self.feed.pk)\
|
||||
now = datetime.datetime.now()
|
||||
latest_story = MStory.objects(story_feed_id=self.feed.pk,
|
||||
story_date__lte=now)\
|
||||
.order_by('-story_date').only('story_date').limit(1)
|
||||
if latest_story and len(latest_story) >= 1:
|
||||
cutoff_date = (latest_story[0]['story_date']
|
||||
|
|
|
@ -1255,8 +1255,10 @@ class MSocialSubscription(mongo.Document):
|
|||
cutoff_date = cutoff_date + datetime.timedelta(seconds=1)
|
||||
else:
|
||||
# Use the latest story to get last read time.
|
||||
now = datetime.datetime.now()
|
||||
latest_shared_story = MSharedStory.objects(user_id=self.subscription_user_id,
|
||||
shared_date__gte=user_profile.unread_cutoff
|
||||
shared_date__gte=user_profile.unread_cutoff,
|
||||
story_date__lte=now
|
||||
).order_by('-shared_date').only('shared_date').first()
|
||||
if latest_shared_story:
|
||||
cutoff_date = latest_shared_story['shared_date'] + datetime.timedelta(seconds=1)
|
||||
|
|
Loading…
Add table
Reference in a new issue