I previously had a LOAD of "8753_20071221203559.mpg" etc entries at the top of the videos screen. I noticed that in the filesystem there were actually a lot more mythtv recordings than there were in mythweb. So first I sorted this out:
#!/bin/sh
mysqldump mythconverg recorded > /tmp/recorded
cd /home/public/data/videos/tv_shows_1
mkdir orphans
for file in *.mpg ; do
echo "Looking for $file"
results=`grep $file /tmp/recorded | awk -F\/ '{print $7}' | awk -F \' '{print $1}' | wc -l`
if [ $results -eq 0 ] ; then
echo "Error! Not found!!"
mv $file orphans/
mv $file.* orphans/
fi
echo " "
done
I later moved this orphans folder to another place on my file system and then at the end deleted it. Now I had to remove them from the pluto database:
# mysql pluto_media
> delete from File where Path like '%tv_show%';
> quit
As you can see I decided to delete all my tv recordings. Don't panic, as attributes are held in the id3 files on the filesystem.
I resynchronised the folder and now only had a couple of pages of videos messing up the top of my list. So I created a script to repeat the mythtv "save recording to pluto database" function. As a test I deleted all the id3 files for the mythtv recordings.
Script:
#!/bin/sh
dir=$1
cd $dir
for file in *.mpg ; do
echo "Adding $file to LMCE db"
f=\'$file\'
chanid=`mysql mythconverg -se "select chanid from recorded where basename = $f" | tail -1`
starttime=`mysql mythconverg -se "select starttime from recorded where basename = $f" | tail -1`
mysql mythconverg -se "select title,subtitle from recorded where basename = $f" | tail -1
echo "Running /usr/pluto/bin/SaveMythRecording.sh "$chanid" "$starttime" "$dir" "$file""
/usr/pluto/bin/SaveMythRecording.sh "$chanid" "$starttime" "$dir" "$file"
done
Hey presto - the script caused pluto to regenerate the id3 files. It did NOT add the recordings back to the db though which I found odd. I had to do a resynchronise from the web admin site. No errors in the DCERouter log.
HOWEVER, I have 7 files which LMCE will not regenerate id3 files for. These 7 files are in the mythtv db, and appear in mythweb. When the script above asks LMCE to add them there are no errors in the log. eg:
07 12/22/07 14:18:09.041 Received Message from 0 (unknown / ) to -1001 (unknown / ), type 2 id 69 Event:MythTV Show Recorded, re
try none, parameters: <0x70ce6b90>
07 12/22/07 14:18:09.041 Parameter 29(MythTV ChannelID): 8753 <0x70ce6b90>
07 12/22/07 14:18:09.042 Parameter 35(Name): /home/public/data/videos/tv_shows_1/8753_20071221210000.mpg <0x70ce6b90>
07 12/22/07 14:18:09.042 Parameter 57(DateTime): 2007-12-21 21:00:00 <0x70ce6b90>
But no id3 file.
I've learnt a lot, but have some questions:
1. Why no id3 file for a few videos?
2. Why are recordings not added to the db?
3. I have "Update media daemon" unchecked, does this affect number 2?
4. Event with Update media daemon unchecked overnight LMCE has added media in folders I never chose to synchronise. have I misunderstood this function?
Thanks,
Chris