1
0
mirror of https://github.com/instaloader/instaloader.git synced 2024-10-03 22:07:11 +02:00

Fix Hashtag.get_all_posts() missing one post in certain cases

When a hashtag query returned only the 9 top posts, get_all_posts() yielded only 8 instead of all 9 posts.

Closes #853.
This commit is contained in:
Alexander Graf 2020-11-14 19:53:43 +01:00
parent c7372e36cc
commit cc2986cff3

View File

@ -1359,9 +1359,13 @@ class Hashtag:
next_other = next(other_posts, None)
while next_top is not None or next_other is not None:
if next_other is None:
assert next_top is not None
yield next_top
yield from sorted_top_posts
break
if next_top is None:
assert next_other is not None
yield next_other
yield from other_posts
break
if next_top == next_other: