From d1d011e4f678f942777ebe088c42b9b0ec75ef83 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Wed, 23 Sep 2020 00:45:32 +0200 Subject: [PATCH] avoid thumb and meta generation of incomplete files --- indexmeta.sh | 1 + thumbnail.sh | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) 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 } -- 2.39.2