corrected thumbnum quirk

This commit is contained in:
Paul Wilde 2024-10-16 13:54:12 +01:00
parent 04efcce3c1
commit 18e17da516
2 changed files with 6 additions and 6 deletions

Binary file not shown.

View file

@ -98,12 +98,12 @@ proc compilePage(content: string, video_uri: string = "", search_query: string =
page &= pagination
page &= "<section>"
for idx, url in urls:
let title = url.split("/")[^1].replace("_"," ")
if title == "THUMBNUM":
# This was in Porninvidious, but that uses cut instead of last index,
# so probably not necessary here. Leaving a note in case
echo "THUMBNUM - do something else here"
page &= fmt"""<div><a href="{url}"><img src="{thumbs[idx]}"/><br/>{title}</a></div>"""
var
vid_url, vid_thumb: string
vid_url = url.replace("THUMBNUM","0")
vid_thumb = thumbs[idx].replace("THUMBNUM","1")
let title = vid_url.split("/")[^1].replace("_"," ")
page &= fmt"""<div><a href="{vid_url}"><img src="{vid_thumb}"/><br/>{title}</a></div>"""
page &= "</section>"
if pagination != "":
page &= pagination