From 09384aa5e9135f1f7b75a909146b91d216ff444b Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Sat, 16 Aug 2025 11:10:25 +1000 Subject: [PATCH] moved to container --- CopyFromRecordingsToVideo.sh | 87 ------------------------------------ 1 file changed, 87 deletions(-) delete mode 100755 CopyFromRecordingsToVideo.sh diff --git a/CopyFromRecordingsToVideo.sh b/CopyFromRecordingsToVideo.sh deleted file mode 100755 index 24d27d8..0000000 --- a/CopyFromRecordingsToVideo.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/bash - -VID_DIR=/export/docker/storage/other-videos -RDIR=/export/myth/tv -if [ $# -ne 2 ]; then - echo "Usage: $argv " - echo "search will be used as a %title% search in the title field of the recordings, and new-name is a full path to /export/myth/videos and should include any subdirs/xxx.ext" - echo "E.g. $argv "\"Friday Fin\"" /export/docker/storage/other-videos/AFL/2020/Rd1-Away-Carlton.mpg" - exit 0 -else - search=$1 - new_name=$2 - if [ `expr "$new_name" : "$VID_DIR"` = 0 ]; then - echo "The filename you are copying to is not in $VID_DIR, exiting..." - exit 1 - fi -fi - -footy=0 -if [ `expr "$new_name" : "$VID_DIR/AFL"` -gt 0 ]; then - footy=1 -fi -echo "s=$search -- (footy=$footy) & its a full path: $new_name" - -found_in="title" -basename=$(echo -n "select basename from recorded where title like '%$search%'" \ - | mysql --user=mythtv --password=mythtv mythconverg | tail -n1) -full_title=$(echo -n "select title, subtitle from recorded where title like '%$search%'" \ - | mysql --user=mythtv --password=mythtv mythconverg | tail -n1) - -if [ -z $basename ]; then - found_in="subtitle" - basename=$(echo -n "select basename from recorded where subtitle like '%$search%'" \ - | mysql --user=mythtv --password=mythtv mythconverg | tail -n1) - full_title=$(echo -n "select title, subtitle from recorded where subtitle like '%$search%'" \ - | mysql --user=mythtv --password=mythtv mythconverg | tail -n1) -elif [ -z $basename ]; then - echo "Could not match $search in title or subtitle, Exiting..." - exit 2 -fi - -echo "Found: ($basename) (by $found_in match) - $full_title" -echo "Okay to: sudo mv $RDIR/$basename $new_name (y/N?)" -read response - -if [ "$response" != "y" ]; then - echo "Cancelling..." - exit 0; -fi - -sudo mv $RDIR/$basename $new_name -echo "You Need to rescan in myth now... press any key when done" -read response - -sig_bit=`expr $new_name : "$VID_DIR/"` -myth_new_name=${new_name:$sig_bit} - -intid=$(echo -n "select intid from videometadata where filename like '%$myth_new_name'" \ - | mysql --user=mythtv --password=mythtv mythconverg | tail -n1) - -if [ "$intid" = "" ]; then - echo "Something is not right, I can't find the file we just scanned for" - exit 0; -fi - -length_in_sec=`ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 $new_name 2> /dev/null` -length=`echo "$length_in_sec/ 60" | bc` - -echo "update videometadata set length = $length where intid=$intid; -update videometadata set plot = (select description from recorded where basename='$basename') where intid=$intid; -update videometadata set year = year( date( (select starttime from recorded where basename='$basename') )) where intid=$intid; -update videometadata set rating = 'G' where intid=$intid;" \ - | mysql --user=mythtv --password=mythtv mythconverg - -if [ $footy = 1 ]; then - pat='Rd([0-9]+)' - [[ $new_name =~ $pat ]] # $pat must be unquoted - Rd="${BASH_REMATCH[1]}" -# Rd=`echo $new_name | cut -c30-31` - echo "This is a football stream, also copying gfc.jpg, and slotting this in for Round: $Rd" - echo "update videometadata set director = 'AFL Round $Rd' where intid=$intid; -update videometadata set coverfile = '/myth/video-cover-art/gfc.jpg' where intid=$intid;" \ - | mysql --user=mythtv --password=mythtv mythconverg -fi - -# put a zero-byte file in tv dir so it can be deleted out of myth's db -touch $RDIR/$basename