initial commit of bin scripts into git

This commit is contained in:
2023-11-08 13:38:19 +11:00
commit 3735eea3c6
113 changed files with 11631 additions and 0 deletions

26
rename_myth_afl_vid_files Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
ids=$(echo -n "select intid from videometadata where filename like 'Football%'" | mysql --host=mara.ddp.net --user=mythtv --password=mythtv mythconverg 2>&1 | grep -v 'Using a password' | tail -n+2)
echo $ids
for id in $ids;
do
title=$(echo -n "select director from videometadata where intid = '$id'" | mysql --host=mara.ddp.net --user=mythtv --password=mythtv mythconverg 2>&1 | grep -v 'Using a password' | tail -n1)
filename=$(echo -n "select filename from videometadata where intid = '$id'" | mysql --host=mara.ddp.net --user=mythtv --password=mythtv mythconverg 2>&1 | grep -v 'Using a password' | tail -n1)
[[ ${filename} =~ Football/(.*)/.* ]]
year=${BASH_REMATCH[1]}
echo "processing ($filename) -- $id: $title"
input_filename="/export/myth/videos/$filename"
input_dirname=`dirname $filename`
input_basename=`basename $input_filename`
input_base="${input_basename%.*}"
if [ ! -f "/export/myth/videos/$input_dirname/$input_base.mp4" ];
then
echo "***** DID NOT FIND $dirname/$input_base.mp4"
exit 1
fi
$(echo -n "update videometadata set filename='$input_dirname/$input_base.mp4' where intid = '$id'" | mysql --host=mara.ddp.net --user=mythtv --password=mythtv mythconverg 2>&1 | grep -v 'Using a password' | tail -n+2)
done