www-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

www/audio-video/workshop av-create


From: Therese Godefroy
Subject: www/audio-video/workshop av-create
Date: Fri, 11 Nov 2022 16:42:35 -0500 (EST)

CVSROOT:        /webcvs/www
Module name:    www
Changes by:     Therese Godefroy <th_g> 22/11/11 16:42:35

Modified files:
        audio-video/workshop: av-create 

Log message:
        Clean up a big mess.

CVSWeb URLs:
http://web.cvs.savannah.gnu.org/viewcvs/www/audio-video/workshop/av-create?cvsroot=www&r1=1.5&r2=1.6

Patches:
Index: av-create
===================================================================
RCS file: /webcvs/www/www/audio-video/workshop/av-create,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- av-create   11 Nov 2022 19:35:50 -0000      1.5
+++ av-create   11 Nov 2022 21:42:34 -0000      1.6
@@ -102,20 +102,20 @@
   echo "!!! The Duration field has wrong data: $duration; exit"
   exit 1
 fi
-if
-  h=${duration%%:*} && h=${h##0}
-  m=${duration%:*} && m=${m#*:} && m=${m##0}
-  s=${duration##*:} && s=${s##0}
-  errors=""
-  duration=""
-  if [ $h -ne 0 ]; then
+
+h=${duration%%:*} && h=${h#0}
+m=${duration%:*} && m=${m#*:} && m=${m##0}
+s=${duration##*:} && s=${s##0}
+errors=""
+duration=""
+if [ "$h" != "" ]; then
     if [ $h -gt 5 ]; then
       echo "??? Are you sure this recording is $h hours long?"
     fi
     duration=${h}h
     hs=$(( $h * 3600 ))
-  fi
-  if [ $m -ne 0 ]; then
+fi
+if [ "$m" != "" ]; then
     if [ $m -gt 59 ]; then
       m_error="\n    $m min is more than one hour."
       errors=1
@@ -123,29 +123,28 @@
       duration="$duration ${m}min"
       ms=$(( $m * 60 ))
     fi
-  fi
-  if [ $s -ne 0 ]; then
+fi
+if [ "$s" != "" ]; then
     if [ $s -gt 59 ]; then
       s_error="\n    $s s is more than one minute."
       errors=$(( $errors + 1 ))
     else
       duration="$duration ${s}s"
     fi
-  fi
-  if [ "$errors" = "" ]; then
-    ts=$(( $hs + $ms + $s ))
+fi
 
-    if [ $ts -gt 2700 ]; then
+if [ "$errors" != "" ]; then
+  printf 1>&2 "!!! Error(s) in the Duration field: $m_error $s_error\nExit.\n"
+  exit 1
+fi
+
+ts=$(( $hs + $ms + $s ))
+if   [ $ts -gt 2700 ]; then
       tlength='long'
-    elif  [ $ts -lt 600 ]; then
+elif [ $ts -lt  600 ]; then
       tlength='short'
-    else
+else
       tlength='medium'
-    fi
-  else
-    printf 1>&2 "!!! Error(s) in the Duration field: $m_error 
$s_error\nExit.\n"
-    exit 1
-  fi
 fi
 
 awk -v year="$year" -v lang="$lang" -v tlength="$tlength" -v media="$media" \



reply via email to

[Prev in Thread] Current Thread [Next in Thread]