1
0
mirror of https://github.com/zedeus/nitter.git synced 2026-04-13 01:02:22 -04:00

Fix search repeating when the end has been reached

This commit is contained in:
Zed
2026-03-04 11:53:57 +01:00
parent b0773dd934
commit 2898efab6b
4 changed files with 65 additions and 54 deletions

View File

@@ -168,6 +168,11 @@ proc getGraphTweetSearch*(query: Query; after=""): Future[Timeline] {.async.} =
result = parseGraphSearch[Tweets](js, after)
result.query = query
# when no more items are available the API just returns the last page in
# full. this detects that and clears the page instead.
if after.len > 0 and after[0..<64] == result.bottom[0..<64]:
result.content.setLen(0)
proc getGraphUserSearch*(query: Query; after=""): Future[Result[User]] {.async.} =
if query.text.len == 0:
return Result[User](query: query, beginning: true)