Opened 18 years ago

Closed 18 years ago

#646 closed patch (fixed)

Update myth.rebuilddatabase.pl to support the basename, progstart, and progend columns

Reported by: sphery <mtdean@…> Owned by: Isaac Richards
Priority: trivial Milestone: unknown
Component: mythtv Version:
Severity: low Keywords:
Cc: Ticket locked: no

Description

The attached patch updates myth.rebuilddatabase.pl to support the basename, progstart, and progend columns that are now a part of the database schema. Because of the infrequency with which the myth.rebuilddatabase.pl script is used, I didn't feel it warranted the effort required to redesign the script to work more appropriately with the new schema; however, I discussed an approach I felt would be ideal for use with the new schema in the thread starting at the post http://www.gossamer-threads.com/lists/mythtv/dev/155680#155680 (the approach is heavily based off Chris's mythrename.pl script).

Instead, this patch simply adds the new columns into the insert statements. Users must name the files according to the old file naming scheme (i.e. chanid_progstart_progend.nuv, where the progstart and progend must be of the format YYYYMMDDHHiiSS) for the script's automatic program information lookup to work (otherwise, the user will get prompted for all information). Regardless of the format of the name used, the filename extension *must* be ".nuv"--even if it's an MPEG file--for the script to even find the file. If the user does not like the filename (format of the name or extension), he/she may change it after import with mythrename.pl.

Instead of forcing the user to specify a real starttime and endtime, the script simply uses the progstart and progend (which it calls starttime/endtime) as the starttime and endtime, respectively. This does mean that the length of the recording is not necessarily shown correctly, but the extra effort required of the user to specify the actual start and end times of the recording does not seem worth the benefit of doing so. Users wanting actual starttime and endtime information may name their files chanid_starttime_endtime.nuv and type in the appropriate title, subtitle, and description when prompted (since the program information lookup will not succeed).

In the event that a user has a software encoder card (i.e. still uses the ".nuv" file extension with filenames that don't contain the endtime), all files that do not have the endtime (i.e. chanid_starttime.nuv) will result in a prompt, "Non-nuv file <filename> found. Do you want to import? (y/n)" and the user will need to answer, "n". Note that this will also apply to any recording--even from a hardware encoder using MPEG streams--created on a machine with SVN revs [7240] (inclusive) through [7246] (exclusive) (from the time the endtime was removed from the filename until the file extensions were changed to use proper extensions). On a system with hundreds of recordings using the ".nuv" extension without endtime, this will get very tedious. This is why, IMHO, the filename scanning code no longer makes sense, and why I recommended a new script in the posts at the link above.

Although this patch is not the best way to solve the problem, it is definitely the quickest solution, and it works (with qualifications :).

Attachments (1)

myth.rebuild.database-basename_progstart_progend.patch (3.0 KB) - added by sphery <mtdean@…> 18 years ago.

Download all attachments as: .zip

Change History (2)

Changed 18 years ago by sphery <mtdean@…>

comment:1 Changed 18 years ago by cpinkham

Resolution: fixed
Status: newclosed

(In [8020]) Close #646 by applying sphery's patch. This restores myth.rebuilddatabase.pl functionality after the addition of the basename, progstart, and progend fields to the recorded table.

Note: See TracTickets for help on using tickets.