Difference between revisions of "Myth.rebuilddatabase.pl"
m (Added note re: libtime-format-perl) |
|||
Line 54: | Line 54: | ||
$ | $ | ||
</PRE> | </PRE> | ||
+ | ==Prerequisites== | ||
+ | On Ubuntu 7.04 at least, you require the libtime-format-perl package installed. | ||
[[Category:Scripts]] | [[Category:Scripts]] |
Revision as of 09:39, 15 September 2007
Note: The correct title of this article is myth.rebuilddatabase.pl. It appears incorrectly here due to technical restrictions.
myth.rebuilddatabase.pl is a script in the contrib directory that traverses the specified MythTV recordings directory and finds all files with video extensions and checks if they appear in the database. If no entry exists it prompts for identifying information and a recording entry is created.
Let's say you have a recorded program, a *.nuv file for example. And MythTV doesn't know about it (e.g., you copied it from your video directory to a backup location and then deleted it from the MythTV list of recordings). And then you want to re-introduce the recording to MythTV (so the recording shows up again in the list of recordings). How do you do that re-introduction? The myth.rebuilddatabase.pl script can do that for you.
Here's an example session to re-introduce a recording.
$ cd /video $ ls *Peach* JamesAndTheGiantPeach.nuv $ alias myrbdb=/local/mythtv-src/mythtv-0.20/contrib/myth.rebuilddatabase.pl $ mysql -u mythtv -pmythtv mythconverg -e 'SELECT chanid,starttime,endtime,title,subtitle,description FROM recordedprogram WHERE title LIKE "%Peach%"' chanid starttime endtime title subtitle description 1059 2007-08-08 11:00:00 2007-08-08 12:30:00 James and the Giant Peach A kindly British orphan (Paul Terry) escapes his cruel aunts (Joanna Lumley, Miriam Margolyes) to sail the sea on a giant peach with six friendly bugs. Animated. $ $ myrbdb --dbhost localhost --file JamesAndTheGiantPeach.nuv These are the files stored in (/video) and will be checked against your database to see if the exist. If they do not, you will be prompted for a title and subtitle of the entry, and a record will be created. /video/JamesAndTheGiantPeach.nuv Unknown file /video/JamesAndTheGiantPeach.nuv found. Do you want to import? [y]: Enter channel [1002]: 1059 ... title [JamesAndTheGiantPeach]: James and the Giant Peach ... subtitle: Description [Recovered file JamesAndTheGiantPeach.nuv]: A kindly British orphan (Paul Terry) escapes his cruel aunts (Joanna Lumley, Miriam Margolyes) to sail the sea on a giant peach with six friendly bugs. Animated. ... start time (YYYY-MM-DD HH:MM:SS) [2007-08-18 20:33:23]: 2007-08-08 11:00:00 ... duration (in minutes) [60]: 90 Building a seek table should improve FF/RW and JUMP functions when watching this video Do you want to build a seek table for this file? [y]: 2007-08-20 13:12:19.260 Using runtime prefix = /usr/local 2007-08-20 13:12:19.348 New DB connection, total: 1 2007-08-20 13:12:19.366 mythcommflag version: 0.20.20060828-3 www.mythtv.org 2007-08-20 13:12:19.374 Enabled verbose msgs: important MythTV Commercial Flagger, started at Mon Aug 20 13:12:19 2007 Rebuilding SeekTable(s) for: ChanID Start Time Title Status ------ -------------- ----------------------------------------- ------ 2007-08-20 13:12:21.400 New DB connection, total: 2 1059 20070808110000 James and the Giant Peach 2007-08-20 13:12:21.554 Using protocol version 30 99%/ 1935fpsRebuilt Finished commercial break flagging at Mon Aug 20 13 $
Prerequisites
On Ubuntu 7.04 at least, you require the libtime-format-perl package installed.