[mythtv-users] I need to reinstall my backend

R. G. Newbury newbury at mandamus.org
Sat Feb 27 22:14:26 UTC 2010

On 02/27/2010 04:23 PM, Nick Rout wrote:
> On Sun, Feb 28, 2010 at 5:12 AM, Michael T. Dean
> <mtdean at thirdcontact.com>  wrote:
>> On 02/27/2010 08:12 AM, Ian Oliver wrote:
>>> Ian Oliver wrote:
>>>> Thanks, re-install done, mythconverg restored, recordings all back in
>>>> place, and everything set up more or less how I want it.
>>> Drat, I didn't notice but I must have restored an old database and I've
>>> lost a few recordings.  Is there any way to put these back into the
>>> database or do I need to move the mpg files across to the videos
>>> directory?
>> Best bet is to put them in MythVideo.
>> You can, if you like, use the old, legacy, unmaintained,
>> use-at-your-own-risk scripts myth_find_orphans.pl and
>> myth.rebuilddatabase.pl to put the data into the database (but note that
>> they will not insert some required information and will put some bad
>> information in the database--thus my recommendation that you just stick the
>> shows in MythVideo).
> If those scripts are so bad, why are they still distributed with
> mythtv and why is there no warning in the wiki? I could put something
> in the wiki but I don't know enough about why they are bad to say
> anything too intelligent (other than to point to this thread).
> More importantly does anyone know what to do to fix them? They seem to
> be useful :)

myth.rebuilddatabase.pl works. It does everything needed to put a 
recording into the database, but it only enters generic information. 
It's major default is that it does not enter the  filesize of the video 
file into the system. As a result, myth will not play the file.

I use the following as a script and run it with each file name (as myth 
understands it) to poke the size into the 'filesize' field. The little 
but of awk code is compliments of someone on the list.

# You can do something like this:
SIZE=`ls -l $1 | awk '{print $5}'`
echo "   File  $1  is  $SIZE bytes"

mysql -u mythtv -pmythtv mythconverg << EOF
update recorded set filesize = '$SIZE' where basename = '$1';

# run as 'myth.fix.filesize 2231_20091031232800.mpg'

This is in the wiki somewhere.

But if you have enough knowledge of perl, Nick to pop this or something 
like it, into the middle of the main myth.rebuilddatabase.pl loop that 
would be great.


         Please let me know if anything I say offends you.
          I may wish to offend you again in the future.

          Tux says: "Be regular. Eat cron flakes."

More information about the mythtv-users mailing list