Skip to content

Commit

Permalink
make sure the fix slice does not break aggregations in many singles
Browse files Browse the repository at this point in the history
  • Loading branch information
tbarbugli committed Oct 18, 2013
1 parent c2211e9 commit 95ad43a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion feedly/feeds/aggregated_feed/realtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,18 @@ def fix_aggregation_slice(self, selected_aggregations, excluded_activities):
if min(selected_activities) > most_recent_not_selected_activity:
return selected_aggregations

orphaned_aggregations = []

for aggregated in selected_aggregations:
for activity in aggregated.activities:
if activity < most_recent_not_selected_activity:
aggregated.remove(activity)
return selected_aggregations
if len(aggregated.activities) == 1:
orphaned_aggregations.append(aggregated)

selected_aggregations = [a for a in selected_aggregations if a not in orphaned_aggregations]
selected_aggregations = self.get_aggregator().merge(selected_aggregations, not_selected_activities)[0]
return self.fix_aggregation_slice(selected_aggregations, excluded_activities)

def get_activity_slice(self, start=None, stop=None, rehydrate=True):
if start not in (0, None):
Expand Down

0 comments on commit 95ad43a

Please sign in to comment.