parent
d6a2cd324f
commit
8afad3b937
|
@ -84,12 +84,15 @@ proc createTimelineRouter*(cfg: Config) =
|
||||||
get "/@name/?@tab?":
|
get "/@name/?@tab?":
|
||||||
cond '.' notin @"name"
|
cond '.' notin @"name"
|
||||||
cond @"tab" in ["with_replies", "media", "search", ""]
|
cond @"tab" in ["with_replies", "media", "search", ""]
|
||||||
var rss = "/$1/$2/rss" % [@"name", @"tab"]
|
|
||||||
let query =
|
let query =
|
||||||
case @"tab"
|
case @"tab"
|
||||||
of "with_replies": getReplyQuery(@"name")
|
of "with_replies": getReplyQuery(@"name")
|
||||||
of "media": getMediaQuery(@"name")
|
of "media": getMediaQuery(@"name")
|
||||||
of "search": initQuery(params(request), name=(@"name"))
|
of "search": initQuery(params(request), name=(@"name"))
|
||||||
else: Query()
|
else: Query()
|
||||||
if @"tab" == "search": rss &= "?" & genQueryUrl(query)
|
var rss = "/$1/$2/rss" % [@"name", @"tab"]
|
||||||
|
if @"tab".len == 0:
|
||||||
|
rss = "/$1/rss" % @"name"
|
||||||
|
elif @"tab" == "search":
|
||||||
|
rss &= "?" & genQueryUrl(query)
|
||||||
respTimeline(await showTimeline(request, query, cfg, rss))
|
respTimeline(await showTimeline(request, query, cfg, rss))
|
||||||
|
|
Loading…
Reference in New Issue