[mythtv-users] list my "damaged" recordings
Evuraan
evuraan at gmail.com
Mon Oct 26 18:55:19 UTC 2015
>> how can i list my damaged recordings (so I can programmatically delete
>> those..)?
>>
thank you for the pointers, that helped immensely!
#!/bin/bash
user_name="XXXX"
pass_word="YYYY"
RECORDINGDIR="/var/lib/mythtv/recordings"
SQLSCRIPT="/tmp/recordings.sql-txt-$RANDOM-$RANDOM"
mysql="mysql -u $user_name -p$pass_word mythconverg"
remove_myth(){
[ -s "${RECORDINGDIR}/${a}" ] && { rm -fv "${RECORDINGDIR}/${a}" ;
echo "DELETE FROM mythconverg.recorded WHERE basename = '$a';"
> $SQLSCRIPT
[ -s "$SQLSCRIPT" ] && $mysql < $SQLSCRIPT
}
}
$mysql -e "select starttime from recordedprogram where videoprop like
'%DAMAGED%'" | while read b ; do $mysql -e " select basename from
recorded where starttime='$b'" ; done |grep mpg | while read a
do
remove_myth $a
done
rm $SQLSCRIPT 1>/dev/null 2>&1 || :
More information about the mythtv-users
mailing list