X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=indexmeta.sh;h=e37e5da6c3696cffd979639798a785dff84ff69a;hb=db0868f2e033589fcc6e61ae84cce7d4e3766933;hp=2da085f9a0bf86fcdb630f8fd98443df7d99c423;hpb=83ae7baa92d4bf2010666435813bb965f7c71561;p=serve0 diff --git a/indexmeta.sh b/indexmeta.sh index 2da085f..e37e5da 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 '' \ @@ -82,24 +83,23 @@ meta_dir(){ if [ -d "$dir/.index" -a \! -f "$meta" ] && LOCK "$meta"; then touch "$meta" # preliminary touch to prevent concurrent generators - find "$dir" -type f -mindepth 1 -maxdepth 1 \ + find -L "$dir" -type f -mindepth 1 -maxdepth 1 \ | grep -aE "$file_pattern" \ | while read -r v; do meta_line "$v" done >"$meta" + touch "$metat" RELEASE "$meta" elif [ -d "$dir/.index" -a "$dir" -nt "$metat" ] && LOCK "$meta"; then - cp -p "$meta" "$meta.ref"; touch "$meta" - find "$dir" -type f -newer "$metat" \ + touch "$meta" + find -L "$dir" -type f -newer "$metat" \ -mindepth 1 -maxdepth 1 \ | grep -aE "$file_pattern" \ | while read -r v; do grep -qF " $(meta_name "$v")" "$meta" \ || meta_line "$v" done >>"$meta" - sort -u "$meta" >"$meta.ref" - mv "$meta.ref" "$meta" touch "$metat" RELEASE "$meta"