Add search button and fix unset timeline beginning

This commit is contained in:
Zed
2019-09-19 04:51:17 +02:00
parent 19659de410
commit 70c42dd05a
6 changed files with 11 additions and 7 deletions

View File

@@ -42,7 +42,7 @@ proc getSearch*[T](query: Query; after, agent: string): Future[Result[T]] {.asyn
}
let json = await fetchJson(base / searchUrl ? params, headers)
if json == nil: return Result[T](query: query)
if json == nil: return Result[T](query: query, beginning: true)
result = getResult[T](json, query, after)
if not json.hasKey("items_html"): return

View File

@@ -5,7 +5,7 @@ import ".."/[types, parser, parserutils, formatters, query]
import utils, consts, media
proc finishTimeline*(json: JsonNode; query: Query; after, agent: string): Future[Timeline] {.async.} =
if json == nil: return Timeline()
if json == nil: return Timeline(beginning: true, query: query)
result = Timeline(
hasMore: json["has_more_items"].to(bool),