diff --git a/ingestfile b/ingestfile index 4994952c..1e33accf 100755 --- a/ingestfile +++ b/ingestfile @@ -79,6 +79,13 @@ _ask_digitization_logs(){ [[ ! -z "${FILES}" ]] && _writeingestlog "digitization_logs: ${FILES}\n" } +_ask_restoration(){ + _report -qn "Drag in any restoration master: " + read -e -a RESTORATION_FILE + [[ "${RESTORATION_FILE[0]}" = "q" ]] && exit 0 + [[ ! -z "${RESTORATION_FILE}" ]] && _writeingestlog "restoration: ${RESTORATION_FILE}\n" +} + # spreadsheet fields are currently CUNY-specific _parse_spreadsheet(){ DIGITIZATIONLOG=$(_maketemp) @@ -492,6 +499,7 @@ fi _setup_package if [[ "${MODE}" == "audio" ]] ; then _ask_digitization_logs + _ask_restoration _ask_photos "${MEDIAID}" if [[ -f ${FILES} ]] ; then _parse_spreadsheet @@ -616,17 +624,25 @@ FROM=$(_get_filesystem "${INPUT}") TO=$(_get_filesystem "${OBJECTSDIR}/") if [ "${FROM}" == "${TO}" -a "${CLEANUPDECISION}" == "Remove source file after successful ingest" ] ; then _report -dt "Because ${INPUT} and ${OBJECTSDIR} are on the same filesystem and preservation mode is enabled we will mv rather than rsync." - _run_critical mv -v -n "${INPUT}" "${OBJECTSDIR}/" + _run_critical mv -v -n "${INPUT[@]}" "${OBJECTSDIR}/" if [ ! "${#FILES[@]}" = 0 ] ; then _run_critical mv -v -n "${FILES[@]}" "${LOGDIR}/" fi + if [ ! "${#RESTORATION_FILE[@]}" = 0 ] ; then + _mkdir2 "${OBJECTSDIR}/restoration" + _run_critical mv -v -n "${RESTORATION_FILE[@]}" "${OBJECTSDIR}/restoration/" + fi else _report -dt "STATUS Copying the original file to library storage at ${OBJECTSDIR}." LOGFILE="${LOGDIR}/rsync_$(_get_iso8601_c)_$(basename ${0})_${VERSION}.txt" - "${SCRIPTDIR}/migratefiles" -l "${LOGFILE}" -o "${OBJECTSDIR}" "${INPUT}" + "${SCRIPTDIR}/migratefiles" -l "${LOGFILE}" -o "${OBJECTSDIR}" "${INPUT[@]}" if [ ! "${#FILES[@]}" = 0 ] ; then _run_critical rsync -rt --progress --log-file="${LOGDIR}/rsync_$(_get_iso8601_c)_$(basename $0)_${VERSION}.txt" "${FILES[@]}" "${LOGDIR}/" fi + if [ ! "${#RESTORATION_FILE[@]}" = 0 ] ; then + _mkdir2 "${OBJECTSDIR}/restoration" + _run_critical rsync -rt --progress --log-file="${LOGDIR}/rsync_$(_get_iso8601_c)_$(basename $0)_${VERSION}.txt" "${RESTORATION_FILE[@]}" "${OBJECTSDIR}/restoration/" + fi fi # set makederivopts diff --git a/mmfunctions b/mmfunctions index cb9d3cf6..81801305 100755 --- a/mmfunctions +++ b/mmfunctions @@ -997,8 +997,14 @@ _find_input (){ fi ISOBJECT="Y" INPUTFILES=$(_maketemp) + if [[ -d "${1}/objects/restoration" ]] ; then + LOOKHERE="${1}/objects/restoration" + _report -dt "This package contains a restoration, using that for processing." + else + LOOKHERE="${1}/objects" + fi # find av files in a directory and output to a temp list - find "${1}/objects" -type f -size +0 "${OBJECTS_FIND_EXCLUSIONS[@]}" | while read file ; do + find "${LOOKHERE}" -type f -size +0 "${OBJECTS_FIND_EXCLUSIONS[@]}" | while read file ; do streamcount=$(ffprobe -loglevel quiet "$file" -show_entries format=nb_streams -of default=nw=1:nk=1) duration_ts=$(ffprobe -loglevel quiet "$file" -show_entries stream=duration_ts -of default=nw=1:nk=1) if [[ "$streamcount" > 0 && "${duration_ts}" != 1 ]] ; then @@ -1033,7 +1039,7 @@ _find_input (){ fi fi else - _report -wt "A valid source file isn't found in ${1}/objects." + _report -wt "A valid source file isn't found in ${LOOKHERE}." _writeerrorlog "_find_input" "A valid source file was not found, so the script could not proceed." exit 1 fi