From 083801049509ba69b8a065be6e0842d4cbe83e38 Mon Sep 17 00:00:00 2001 From: Dave Rice Date: Wed, 10 Apr 2019 15:00:20 -0400 Subject: [PATCH] if no pbcore data from protrack, try with fmpbcore if available --- prot2rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/prot2rs b/prot2rs index cbcd1ac..feead37 100755 --- a/prot2rs +++ b/prot2rs @@ -108,6 +108,14 @@ _query_protrack_push_to_resourcespace(){ TEMPXML=$(_maketemp) # get PBCore XML for that mediaid "${SCRIPTDIR}/pbprotracktor" "${MEDIAID}" | _remove_empty_xml_nodes 2> /dev/null > "${TEMPXML}" + if [[ -f "${SCRIPTDIR}/fmpbcore" && -f "${TEMPXML}" && ! -s "${TEMPXML}" ]] ; then + echo "No data retrived from protrack. Now trying to grab pbcore for ${MEDIAID} using fmpbcore." + "${SCRIPTDIR}/fmpbcore" "${MEDIAID}" | _remove_empty_xml_nodes 2> /dev/null > "${TEMPXML}" + fi + if [[ ! -s "${TEMPXML}" ]] ; then + echo "Error, no pbcore data found for ${MEDIAID}." + return + fi xml val "${TEMPXML}" >/dev/null if [ "${?}" != "0" ] ; then echo "pbprotracktor did not return a result for ${MEDIAID}, skipping."