]> git.plutz.net Git - rawnet/commitdiff
display video duration in thumbnail
authorPaul Hänsch <paul@plutz.net>
Wed, 6 Oct 2021 23:56:50 +0000 (01:56 +0200)
committerPaul Hänsch <paul@plutz.net>
Wed, 6 Oct 2021 23:56:50 +0000 (01:56 +0200)
page_channel.sh
rawnet.css

index 72553ba112577a111d45453022242f854513da3c..8d1d1837fc2018d4765cc748c730746ad9745d32 100755 (executable)
@@ -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
index 557bc825cb7bc2d5dcc659f7ba119ebaacde227d..a4b55481b30eb5b0907722f2bc74e0de967f1616 100644 (file)
@@ -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;