hostname patch for nuvexport (was Re: [mythtv-users] nuvexport - new version)

John M Wright myth at wakamole.homeip.net
Tue Sep 2 20:34:12 EDT 2003


Here's a patch that adds the hostname field to the
sql that gets the video dir from the settings table. Since
different hosts can have different settings, you could get
the wrong setting of settings if you don't restrict by hostname.

I didn't make any changes to the code that modifies the settings
table to notify of data changes (look for 'UPDATE settings...')
but that might be needed to (I'm not exactly sure what modifying
this setting will do).

The patch is small, so I'm adding it inline.
Thanks
~John

--- nuvexport.old       2003-09-01 14:47:51.000000000 -0500
+++ nuvexport   2003-09-02 19:29:05.000000000 -0500
@@ -114,12 +114,17 @@
        }
        close CONF;

+# Determine my hostname
+        my $this_hostname = `hostname`;
+        chomp($this_hostname);
+
 # Connect to the database
        my $dbh = DBI->connect("dbi:mysql:database=$db_name:host=$db_host", $db_user, $db_pass)
                or die "Cannot connect to database: $!\n\n";

 # Find the directory where the recordings are located, and grab all of the filenames
        my $q = "SELECT data FROM settings WHERE value='RecordFilePrefix'";
+        $q .= " AND hostname='$this_hostname'" if ($this_hostname);
        my $sh = $dbh->prepare($q);
                $sh->execute or die "Could not execute ($q):  $!\n\n";
        our ($video_dir) = $sh->fetchrow_array;



On Monday 01 September 2003 03:10 am, Chris Petersen wrote:
> http://forevermore.net/myth/
>
> New version.  I spent quite awhile last night rewriting the core of the
> script.  It's now object-based, including the UI (which should allow for
> other UI's - curses, etc - to be added with relative ease), and includes
> a little better error display.
>
> I also fixed an issue with svcd encoding and mp2enc (for those who don't
> use toolame).  Because of the core rewrite, the divx and wmv exporters
> are now disabled (they didn't work right before, anyway).  I'll accept
> patches from anyone who wants to update these sections for the new code
> (preferably using mythtranscode and ffmpeg as needed).
>
> Some users are also getting some weirdness with the script not being
> able to find their show listings.  If you experience this, there's not
> much I can do at the moment to help you, as I have no way to replicate
> the problem in order to debug it.  However, I'm happy to work with
> people to debug and find the problem.
>
> -Chris
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


More information about the mythtv-users mailing list