]> git.plutz.net Git - rawnet/commitdiff
consistent variable use, move AUTHOR function to db_channel
authorPaul Hänsch <paul@plutz.net>
Fri, 22 Oct 2021 14:34:15 +0000 (16:34 +0200)
committerPaul Hänsch <paul@plutz.net>
Fri, 22 Oct 2021 14:34:15 +0000 (16:34 +0200)
db_channel.sh
page_video.sh
upload.sh
widgets.sh

index 1df83feeb58b2826de88848d4f40e9b62cc2f807..bb2496164faaae6fd28d97e8899c0d8eb68db424 100755 (executable)
@@ -103,3 +103,11 @@ new_channel(){
     return 1
   fi
 }
+
+AUTHOR(){
+  if [ "$CHANNEL_ID" -a "$USER_ID" -a ! "${CHANNEL_AUTHORS##*${USER_ID}*}" ]; then
+    return 0
+  else
+    return 1
+  fi
+}
index 74e03e60b5e5055f63a6a77ef98cd720a6f80383..9e49a6fdefae7afaed27c164c335fee232e6bad0 100755 (executable)
@@ -5,7 +5,6 @@ includepage_video="$0"
 
 . "$_EXEC/db_channel.sh"
 . "$_EXEC/db_video.sh"
-. "$_EXEC/widgets.sh"
 . "$_EXEC/upload.sh"
 
 read_channel "$channel"
index e698573b84d3289e18edd809af53d3a78ab0f3e3..f9e42965b7b36a864ada0fe983c22fdf2887364d 100755 (executable)
--- a/upload.sh
+++ b/upload.sh
@@ -43,11 +43,12 @@ frame_uploadprogress() {
   </head><body id=uploadprogress>
   ' "$_BASE"
   printf '<div class=progress><div class=bar style="width: 0%%;"></div><div class=count>%i / %i</div></div>\n' 0 0
-  while [  ! -f "$_DATA/$CHANNEL_ID/${VIDEO_ID}.upload.mp4" \
-        -a ! -f "$_DATA/$CHANNEL_ID/${VIDEO_ID}.upload.mp4.upload" ]; do sleep 1; done
-  read size <"$_DATA/$CHANNEL_ID/${VIDEO_ID}.upload.mp4.upload"
-  while [ -f "$_DATA/$CHANNEL_ID/${VIDEO_ID}.upload.mp4.upload" ]; do
-    stat="$(stat -c %s "$_DATA/$CHANNEL_ID/${VIDEO_ID}.upload.mp4" 2>&-)"
+  while [  ! -f "${VIDEO_FILE}" -a ! -f "${VIDEO_FILE}.upload" ]; do
+    sleep 1
+  done
+  read size <"${VIDEO_FILE}.upload"
+  while [ -f "${VIDEO_FILE}.upload" ]; do
+    stat="$(stat -c %s "$VIDEO_FILE" 2>&-)"
     printf '<div class=progress><div class=bar style="width:%i%%;"></div><div class=count>%iMB / %iMB</div></div>\n' \
       "$(( stat * 100 / size ))" "$((stat / 1048576))" "$((size / 1048576))"
     sleep 1
index 1aa6272a2e9fb29cafe4713c3e7d94f30ffe799a..f844ba4db31b1032dc4d4aefaf2b0938db1941b3 100755 (executable)
@@ -6,14 +6,6 @@ include_widgets="$0"
 . "$_EXEC/db_channel.sh"
 . "$_EXEC/db_video.sh"
 
-AUTHOR(){
-  if [ "$CHANNEL_ID" -a "$USER_ID" -a ! "${CHANNEL_AUTHORS##*${USER_ID}*}" ]; then
-    return 0
-  else
-    return 1
-  fi
-}
-
 w_video(){
   local thumb
   eval "$LOCAL_VIDEO"