Refactor Thread -> Chain to nimsuggest errors

This commit is contained in:
Zed
2019-10-08 20:47:45 +02:00
parent 5ae2e57da8
commit e6f1e55c15
5 changed files with 18 additions and 18 deletions

View File

@@ -18,7 +18,7 @@ macro genMediaGet(media: untyped; token=false) =
single = ident("get" & mediaName)
quote do:
proc `multi`*(thread: Thread | Timeline; agent: string; token="") {.async.} =
proc `multi`*(thread: Chain | Timeline; agent: string; token="") {.async.} =
if thread == nil: return
var `media` = thread.content.filterIt(it.`media`.isSome)
when `token`:

View File

@@ -4,7 +4,7 @@ import sequtils, strutils, json, uri
import ".."/[types, parser, parserutils, formatters, query]
import utils, consts, media, search
proc getMedia(thread: Thread | Timeline; agent: string) {.async.} =
proc getMedia(thread: Chain | Timeline; agent: string) {.async.} =
await all(getVideos(thread, agent),
getCards(thread, agent),
getPolls(thread, agent))
@@ -17,7 +17,7 @@ proc finishTimeline*(json: JsonNode; query: Query; after, agent: string): Future
if not json.hasKey("items_html"): return
let html = parseHtml(json["items_html"].to(string))
let thread = parseThread(html)
let thread = parseChain(html)
await getMedia(thread, agent)
result.content = thread.content