Skip to content

Commit

Permalink
use OBJECTS_FIND_EXCLUSIONS array
Browse files Browse the repository at this point in the history
to standardize how to search in objects
  • Loading branch information
dericed committed Mar 13, 2018
1 parent 0d84680 commit 7aa1625
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion makeframemd5
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ while [ "${*}" != "" ] ; do
_set_up_framemd5
cd "${PACKAGE_PATH}"
FILELIST=$(_maketemp)
find "./objects" -type f ! -name ".*" ! -path "*/access/*" ! -path "*/service/*" > "${FILELIST}"
find "./objects" -type f "${OBJECTS_FIND_EXCLUSIONS[@]}" > "${FILELIST}"
(IFS=$'\n'
for FILE in $(cat "${FILELIST}") ; do
VIDEOTEST=$(file -Ib "${FILE}" | grep 'video')
Expand Down
7 changes: 6 additions & 1 deletion mmfunctions
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
SCRIPTNAME=$(basename "${0}")
SCRIPTDIR=$(dirname "${0}")

OBJECTS_FIND_EXCLUSIONS=(! -name ".*")
OBJECTS_FIND_EXCLUSIONS+=(! -path "*/access/*")
OBJECTS_FIND_EXCLUSIONS+=(! -path "*/service/*")
OBJECTS_FIND_EXCLUSIONS+=(! -path "*/trimmed_materials/*")

# load configuration file
if [ -f "${TEMP_MMCONFIG}" ] ; then
# for use in ingestfiletest; prevents test files from going to permanent storage
Expand Down Expand Up @@ -991,7 +996,7 @@ _find_input (){
ISOBJECT="Y"
INPUTFILES=$(_maketemp)
# find av files in a directory and output to a temp list
find "${1}/objects" -type f -size +0 ! -path "*/access/*" ! -path "*/service/*" ! -name ".DS_Store" | while read file ; do
find "${1}/objects" -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
Expand Down

0 comments on commit 7aa1625

Please sign in to comment.