[mythtv] myth.rebuilddatabase.pl with new filenames

Michael T. Dean mtdean at thirdcontact.com
Wed Oct 19 20:36:57 UTC 2005


Carl Reynolds wrote:

> I looked at your patch and you don't seem to be updating the progstart 
> and progend fields in the recorded table. Shouldn't you add those into 
> the insert statement in line 281 as well as the execute statement in 285?

Good catch.  Told you it wasn't ready for Trac.  I'm on DBSchemaVer 
1095, so I haven't yet gotten the progstart/progend columns...

>
> Also shouldn't we take  .$ext out of the glob statement at line 197?

No.  This is what I was talking about in my description of the patch 
(that you cut from your reply)--you must name the files according to the 
old naming convention (chanid_starttime_endtime.nuv).  If you scan for 
all the files, you'll get all the thumbnails, all the directories, and 
any other unrelated files.  It would prompt for all of them.  Therefore, 
I still maintain that this "verification" functionality--scan for 
everything (or even all the ".nuv" files)--doesn't make sense with the 
current implementation of Myth file handling.  That's why I'm suggesting 
a completely new program instead of trying to adapt the old 
functionality (which made sense with the old file handling) to the new 
file handling.


_Proposal_:

Since there's no file naming convention anymore, it would be up to the 
user to identify the files to import (it doesn't make sense to rely on 
any filename patterns).  Assuming the user wants all the files imported 
doesn't make sense since the number of recordings is likely to be small 
compared to the number of files available and since the user no longer 
has to store recordings within the top-level recording directory (they 
can be in a subdirectory--including a network file system mounted within 
the recording directory).  Also, checking that the files actually exist 
doesn't make sense, either, since some of the files may exist on local 
storage on another backend (and, therefore, won't be found on local 
storage on this backend).

IMHO, we should create a script that either a) accepts info as 
command-line arguments and/or b) prompts the user for info.  (Whether it 
accepts command-line args or not, it needs the ability to prompt the 
user for info--otherwise, we're forcing the user to deal with things 
like maximum command-line length and shell-based quoting/escaping 
issues.)  It would be possible to allow the user to easily provide 
information by asking for channel id--even listing the available channel 
ID's, channel numbers, and channel names and allowing the user to select 
an option or type their own).  Then, the script should ask for the start 
date/start time (allowing the user to provide a complete start time or 
simply the date).  Then, if the user provided a chanid/date that exists 
within the data in oldrecorded, display a list of shows from that date 
for the user to select or allow the user to specify a different time.  
If the user selected a show, verify the info and then insert it into the 
db (and update the recstatus in oldrecorded).  If not, then continue 
prompting for the additional required information.

Comments?  Suggestions?

Mike


More information about the mythtv-dev mailing list