Add photo rail support

This commit is contained in:
Zed
2019-07-04 04:18:32 +02:00
parent 080d4774cf
commit 141bfdc508
8 changed files with 103 additions and 5 deletions

View File

@ -12,10 +12,11 @@ proc showTimeline(name, after: string; query: Option[Query]): Future[string] {.a
let
username = name.strip(chars={'/'})
profileFut = getCachedProfile(username)
railFut = getPhotoRail(username)
var timelineFut: Future[Timeline]
if query.isNone:
timelineFut = getTimeline(username, after)
timelineFut = getTimeline(username, after)
else:
timelineFut = getTimelineSearch(username, after, get(query))
@ -23,7 +24,7 @@ proc showTimeline(name, after: string; query: Option[Query]): Future[string] {.a
if profile.username.len == 0:
return ""
let profileHtml = renderProfile(profile, await timelineFut, after.len == 0)
let profileHtml = renderProfile(profile, await timelineFut, await railFut, after.len == 0)
return renderMain(profileHtml, title=pageTitle(profile))
template respTimeline(timeline: typed) =