From 5330a0366aadcbafcac9b52d36d35b59a3ba9779 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Thu, 7 Oct 2021 01:56:50 +0200 Subject: [PATCH] display video duration in thumbnail --- page_channel.sh | 7 +++++-- rawnet.css | 12 ++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/page_channel.sh b/page_channel.sh index 72553ba..8d1d183 100755 --- a/page_channel.sh +++ b/page_channel.sh @@ -142,7 +142,7 @@ AUTHOR(){ REDIRECT "${_BASE}/channel/${channel}/#ERROR_NEWVIDEO_EXISTS" else # ID NAME DESC RESX RESY LENGTH COVER STATUS UPLOADER HITS FUTUREUSE - printf '%s \\ \\ \\ \\ \\ \\ private %s \\ \\\n' \ + printf '%s \\ \\ \\ \\ \\ \\ void %s \\ \\\n' \ "$video" "$(STRING "$USER_ID")" \ >>"$vid_db" RELEASE "$vid_db" @@ -174,10 +174,13 @@ w_video(){ printf '[div .video .thumb [h3 [a href="%s/channel/%s/%s/" . %s]] [figure [img src="%s" alt=""]] + [span .duration . %i:%02i] [div .description . %s] ]' "$_BASE" "$CHANNEL_ID" "$VIDEO_ID" \ "$(HTML "${VIDEO_NAME:-(Unnamed Video)}")" \ - "$thumb" "$(UNSTRING "$DESCR_CACHE")" + "$thumb" \ + "$((${VIDEO_LENGTH%.*} / 60))" "$((${VIDEO_LENGTH%.*} % 60))" \ + "$(UNSTRING "$DESCR_CACHE")" else return 1 fi diff --git a/rawnet.css b/rawnet.css index 557bc82..a4b5548 100644 --- a/rawnet.css +++ b/rawnet.css @@ -116,6 +116,8 @@ body.channels main .channel { border-radius: 4pt; padding: .5em; margin-bottom: .5em; + height: 15em; + overflow: hidden; } body.channels main .channel > .description { @@ -183,6 +185,16 @@ body.channels main .channel > .description h2 { overflow: hidden; } +.video.thumb .duration { + position: absolute; + right: .375em; top: 10.625em; + font-size: .875em; + padding: 0 .25em; + background-color: #333;; + color: #EEE; + opacity: .75; +} + .video.thumb .description { position: absolute; left:0; right:0; bottom: 3.5em; -- 2.39.2