mirror of https://github.com/zedeus/nitter
Only parse user search if it's a list
This commit is contained in:
parent
5dd85c63d7
commit
c8e8ea3ada
|
@ -80,6 +80,7 @@ proc parseUser*(json: string; username=""): User =
|
|||
proc parseUsers*(json: string; after=""): Result[User] =
|
||||
result = Result[User](beginning: after.len == 0)
|
||||
|
||||
let raw = json.fromJson(seq[RawUser])
|
||||
for user in raw:
|
||||
result.content.add user.toUser
|
||||
if json[0] == '[':
|
||||
let raw = json.fromJson(seq[RawUser])
|
||||
for user in raw:
|
||||
result.content.add user.toUser
|
||||
|
|
Loading…
Reference in New Issue