Skip to content
Snippets Groups Projects
Commit a50e5a23 authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- enhanced validators

- fix in cmd call
parent eb39fe67
Branches
Tags
No related merge requests found
......@@ -81,16 +81,20 @@ declare -A validators
# filetype has max 4 chars
# stage has max 9 chars
# each validator should return true if file was valid
validators[__mediathek_mkv__current]="/usr/bin/mediaconch -ft -p /etc/mediaconch/profile,xml FILE"
validators[__mediathek_mkv_upcoming]="/usr/bin/mediaconch -ft -p /etc/mediaconch/profile,xml FILE"
validators[__mediathek_mka__current]="/usr/bin/mediaconch -ft -p /etc/mediaconch/mediathek_retroaudio.xml FILE"
validators[__mediathek_mka_upcoming]="/usr/bin/mediaconch -ft -p /etc/mediaconch/mediathek_retroaudio.xml FILE"
validators[_______save_mkv__current]="/usr/bin/mediaconch -ft -p /etc/mediaconch/save_retrovideofilm_current.xml FILE"
validators[_______save_mkv_upcoming]="/usr/bin/mediaconch -ft -p /etc/mediaconch/save_retrovideofilm_upcoming.xml FILE"
validators[_______save_mka__current]="/usr/bin/mediaconch -ft -p /etc/mediaconch/save_retroaudio_current.xml FILE"
validators[_______save_mka_upcoming]="/usr/bin/mediaconch -ft -p /etc/mediaconch/save_retroaudio_current.xml FILE"
validators[_____kitodo_tif__current]="/usr/bin/checkit_tiff_current /etc/checkit_tiff/retromono_current FILE"
validators[_____kitodo_tif_upcoming]="/usr/bin/checkit_tiff_upcoming /etc/checkit_tiff/retromono_upcoming FILE"
validators[______lfulg_tif__current]="/usr/bin/checkit_tiff_current /etc/checkit_tiff/retrogeomono_current FILE"
validators[______lfulg_tif_upcoming]="/usr/bin/checkit_tiff_upcoming /etc/checkit_tiff/retrogeomono_upcoming FILE"
validators[___fotothek_tif__current]="/usr/bin/checkit_tiff_current /etc/checkit_tiff/retrofoto_current FILE"
validators[___fotothek_tif_upcoming]="/usr/bin/checkit_tiff_upcoming /etc/checkit_tiff/retrofoto_upcoming FILE"
set -o nounset # Treat unset variables as an error
# Don't just call this function "help()", as that's a reserved command in Bash.
......@@ -296,13 +300,13 @@ scan_file() {
debug "scan_file, using stage: $stage (STAGE mode '$STAGE')"
cmd=$(prepare_cmd "$MODE" "$ftype" "$stage" | sed -e "s#FILE#'$filename'#")
debug "scan_file, calling cmd='$cmd'"
"$cmd" || ( error "failed call of '$cmd', $?"; exit 1)
$cmd || ( error "failed call of '$cmd', $?"; exit 1 )
done
else
debug "scan_file, using stage: $STAGE"
cmd=$(prepare_cmd "$MODE" "$ftype" "$STAGE" | sed -e "s#FILE#'$filename'#")
debug "scan_file, calling cmd='$cmd'"
"$cmd" || ( error "failed call of '$cmd', $?"; exit 1)
$cmd || ( error "failed call of '$cmd', $?"; exit 1 )
fi
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment