</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