[mythtv-users] update recordings database?

Michael T. Dean mtdean at thirdcontact.com
Tue Apr 30 17:28:51 UTC 2013


On 04/30/2013 12:15 PM, leo.butler at member.fsf.org wrote:
>
>     From: "Michael T. Dean"<mtdean at thirdcontact.com>
>
>     On 04/29/2013 09:40 PM, Nick Rout wrote:
>     >  On Tue, Apr 30, 2013 at 1:32 PM, wrote:
>     >
>     >>  Hi, I was experimenting recently and in the process of rolling-back
>     >>  some changes, I overwrote my myth recordings database. The result is
>     >>  that I have 10 days of recordings on the hdd that the backend has no
>     >>  information on.
>     >>
>     >>  Question: how can I add the information on these recordings back to
>     >>  the database?
>     >>
>     >
>     >  Go to one of the backups made druing the 10 day period?
>     >
>     >
>
>     And if you didn't do any backups during those 10 days, the only
>     supported solution is to put those recordings into the Video Library.
>     Video Library is the location for user-managed video (i.e. video where
>     the user provides file name, directory/storage organization) as well as
>     user-provided video (i.e. not-recorded by "this" MythTV
>     instance--meaning not already in the Watch Recordings section).
>
>     If you don't like the idea of some parts of the series being in Watch
>     Recordings and some parts in Video Library, you have 2 options:  1) let
>     MythTV re-record the episodes when/if they re-air or 2) move all the
>     rest of the episodes of that series to Video Library.  Note that moving
>     recordings to Video Library has huge benefits, including better support
>     for large collections of video (Watch Recordings become very cumbersome
>     when you have a lot of recordings), better
>     navigability/sorting/filtering (without having to go back and forth
>     between Watch Recordings and frontend settings to change it), the
>     ability to use meaningful file names (that allow you to identify the
>     content even if you lose the MythTV database), ability to organize the
>     videos how you like (using directories to provide hierarchical
>     organization), excellent metadata support, and more.  IMHO, anyone who
>     keeps recordings--rather than watching and immediately deleting the
>     recording--should seriously consider moving those recordings to Video
>     Library.
>
>     http://www.gossamer-threads.com/lists/mythtv/users/519758#519758
>
>     Note that you can use mythvidexport.py to help you move the recordings.
>
>     http://www.mythtv.org/wiki/Mythvidexport.py
>
>     There are a couple of versions that have some updates for 0.26 out
>     there, and I expect the wiki version will get an update before long (now
>     that mythtranscode's lossless cutting is working, again, the author has
>     started using mythvidexport.py, again, to archive some shows).
>
>
> Mike, thanks for the note. I do use the video library. If I am to
> understand your message, there is no way to migrate recordings to the
> library from a frontend, correct?
>
> I have poked around in the mysql shell, I can find the missing
> recordings in the recordmatch column and I can find matching recorded
> files. I need to figure out how/what to update in the database. That
> shouldn't be too difficult, I hope.
>
> Any pointers/tips would be appreciated.

No need to mess with the database.  What you want to do is:

a) restore the most-recent backup you have to get the greatest number of 
recordings in the database
b) run find_orphans.py to figure out which files are orphaned:  
http://www.mythtv.org/wiki/Find_orphans.py
c) move the orphaned files to Video Library using the system tools 
(cp/mv/drag-and-drop/whatever) to move the file from the recordings 
directory to one of the Videos Storage Group directories
     c.1) You should really rename the files at this point to include 
title and episode information (which will involve playing some portion 
of the video to figure out what's in it).  Name it according to one of 
the schemes at http://www.mythtv.org/wiki/MythVideo_File_Parsing
d) rescan your Video Library (and use it to pull down metadata for the 
recordings)

There are absolutely no direct database changes required (nor recommended).

If you plan to move existing recordings that aren't orphaned to Video 
Library along with the others, you can do so by simply moving the file 
to the Videos directory and giving it a good name, then delete the 
metadata in Watch Recordings (and say yes when it says the file is 
missing and asks if you're sure), and rescan your Video Library.  
Alternatively, use http://www.mythtv.org/wiki/Mythvidexport.py (but you 
may have to hack it a bit to get it to work with current or look in the 
archives for this list for some of the patched versions or wait a week 
or so and you'll likely see an updated version on the wiki).

Mike


More information about the mythtv-users mailing list