From: Paul Hänsch Date: Wed, 6 Oct 2021 23:56:50 +0000 (+0200) Subject: display video duration in thumbnail X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=5330a0366aadcbafcac9b52d36d35b59a3ba9779;p=rawnet display video duration in thumbnail --- 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;