From: Paul Hänsch Date: Tue, 22 Sep 2020 22:45:32 +0000 (+0200) Subject: avoid thumb and meta generation of incomplete files X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=d1d011e4f678f942777ebe088c42b9b0ec75ef83;p=serve0 avoid thumb and meta generation of incomplete files --- diff --git a/indexmeta.sh b/indexmeta.sh index 2da085f..e478324 100644 --- a/indexmeta.sh +++ b/indexmeta.sh @@ -15,6 +15,7 @@ meta_name() { meta_line() { local video l w h video="$1" + [ "${video%.part}" = "$video" -a -s "$video" ] || return 0 read l h w <<__EOF $(printf '' \ diff --git a/thumbnail.sh b/thumbnail.sh index 1430776..f6d212c 100644 --- a/thumbnail.sh +++ b/thumbnail.sh @@ -6,7 +6,7 @@ include_thumbnails="$0" gen_thumb(){ file="$1"; thumb="$2"; - if [ ! -e "$thumb" ] && [ -f "$file" ]; then + if [ "${file%.part}" = "${file}" ] && [ ! -s "$thumb" ] && [ -s "$file" ]; then l="$( printf '' \ | mplayer -input nodefault-bindings -nosound -vo null -identify -frames 0 "$file" 2>&- \ @@ -35,8 +35,5 @@ gen_thumb(){ mv "${tmp}/00000001.jpg" "$thumb" rm -r "${tmp}" - - elif [ ! -e "$thumb" ]; then - touch "$thumb" fi }