corrected misindex issue
This commit is contained in:
parent
69af1f42c6
commit
0c53b754f3
3 changed files with 6 additions and 1 deletions
BIN
Pimvidious
BIN
Pimvidious
Binary file not shown.
|
@ -41,6 +41,7 @@ proc createRouter(): Router =
|
||||||
router.get("/", pageHandler)
|
router.get("/", pageHandler)
|
||||||
router.get("/new/*", pageHandler)
|
router.get("/new/*", pageHandler)
|
||||||
router.get("/video.*/*", videoHandler)
|
router.get("/video.*/*", videoHandler)
|
||||||
|
router.get("/video.*/*/*", videoHandler)
|
||||||
router.get("/video.*/*/*/*", videoHandler)
|
router.get("/video.*/*/*/*", videoHandler)
|
||||||
router.get("/favicon.ico", staticFileHandler)
|
router.get("/favicon.ico", staticFileHandler)
|
||||||
router.get("/favicon.png", staticFileHandler)
|
router.get("/favicon.png", staticFileHandler)
|
||||||
|
|
|
@ -103,7 +103,11 @@ proc compilePage(content: string, video_uri: string = "", search_query: string =
|
||||||
var
|
var
|
||||||
vid_url, vid_thumb: string
|
vid_url, vid_thumb: string
|
||||||
vid_url = url.replace("THUMBNUM","0")
|
vid_url = url.replace("THUMBNUM","0")
|
||||||
|
if thumbs.len > idx:
|
||||||
vid_thumb = thumbs[idx].replace("THUMBNUM","1")
|
vid_thumb = thumbs[idx].replace("THUMBNUM","1")
|
||||||
|
else:
|
||||||
|
vid_url = url.replace("THUMBNUM","1")
|
||||||
|
vid_thumb = thumbs[^1].replace("THUMBNUM","1")
|
||||||
let title = vid_url.split("/")[^1].replace("_"," ")
|
let title = vid_url.split("/")[^1].replace("_"," ")
|
||||||
page &= fmt"""<div><a href="{vid_url}"><img src="{vid_thumb}"/><br/>{title}</a></div>"""
|
page &= fmt"""<div><a href="{vid_url}"><img src="{vid_thumb}"/><br/>{title}</a></div>"""
|
||||||
page &= "</section>"
|
page &= "</section>"
|
||||||
|
|
Loading…
Reference in a new issue