2010-02-09, 05:48
I chagned that function again to use internal variables instead of passing internal to external back to internal. Also, changed conditions. Since it is SYMLINK=Disabled, no link will be created.
Code:
#####REMOVE ENTRIES FROM LIBRARY#####
# myth-remove-from-library.sh - Use to remove a sym-linked mythtv recording and it's database entries. Thanks to barney_1.
SYMLINKDisabled () {
#Make sure we got input arguments and file is valid
if [ -f "$3" ]; then
echo "DATABASE ENTRIES COULD NOT BE DELETED- FILE STILL EXISTS">>"$mythicalLibrarian"/output.log
else "$originaldirname" "$FileBaseName"
#Remove recording entry from 'mythconverg' mysql database
echo "REMOVING - $FileBaseName - THUMBNAILS - DATABASE ENTRIES">>"$mythicalLibrarian"/output.log
echo "REMOVING - $FileBaseName - THUMBNAILS - DATABASE ENTRIES"
mysql -u$MySQLuser -p$MySQLpass -e "use '$MySQLMythDb' ; delete from recorded where basename like '$FileBaseName'; "
#Remove symbolink file and thumbnails
rm -f "$originaldirname/$FileBaseName"
rm -f "$originaldirname/$FileBaseName".*
fi
}