[mythtv] mythweb patch: allways record on channel (on multiple channel)
Michel Goraczko
mythtv-dev@snowman.net
Sat, 7 Dec 2002 17:25:42 -0500
--------------Boundary-00=_UYSRA1GMI3P3IRP98FML
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
This page let you have a setup where you can always record a show on two =
(or=20
more but not all) channels. (As you can setup from mythepg).
Also let you have a time slot and/or single recording coexiste with a "al=
ways=20
record on this channel" on different channels.
This is against the current cvs.
=20
--------------Boundary-00=_UYSRA1GMI3P3IRP98FML
Content-Type: text/x-diff;
charset="us-ascii";
name="mythweb-patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="mythweb-patch"
Common subdirectories: /data/tmp/mythtv/current/mythweb/CVS and mythweb/CVS
diff -u /data/tmp/mythtv/current/mythweb/functions.php mythweb/functions.php
--- /data/tmp/mythtv/current/mythweb/functions.php 2002-12-07 01:25:42.000000000 -0500
+++ mythweb/functions.php 2002-12-07 17:15:16.000000000 -0500
@@ -64,7 +64,7 @@
{
if(strlen($programName) > 0) // Are there program names as short as one character?
{
- $alreadyThereQuery = mysql_query("select title from allrecord where title = \"$programName\"");
+ $alreadyThereQuery = mysql_query("select title from allrecord where title = \"$programName\" and chanid = \"$theChannel\"");
if(mysql_num_rows($alreadyThereQuery) < 1)
{
//
@@ -72,16 +72,20 @@
// so we need to add it
//
// See if the program is being always recorded just on a certain channel
- if ($theChannel) mysql_query("insert into allrecord (title,chanid) values (\"$programName\",\"$theChannel\")");
- else mysql_query("insert into allrecord (title) values (\"$programName\")");
-
- //
- // In case this is elsewhere, we should (?) delete it
- //
-
- mysql_query("delete from singlerecord where title = \"$programName\"");
- mysql_query("delete from timeslotrecord where title = \"$programName\"");
+ if ($theChannel) {
+ mysql_query("delete from allrecord where title = \"$programName\" and chanid is NULL");
+ mysql_query("delete from singlerecord where title = \"$programName\" and chanid = \"$theChannel\"");
+ mysql_query("delete from timeslotrecord where title = \"$programName\" and chanid = \"$theChannel\"");
+ mysql_query("insert into allrecord (title,chanid) values (\"$programName\",\"$theChannel\")");
+ }
+ else {
+ mysql_query("delete from allrecord where title = \"$programName\"");
+ mysql_query("delete from singlerecord where title = \"$programName\"");
+ mysql_query("delete from timeslotrecord where title = \"$programName\"");
+ mysql_query("insert into allrecord (title) values (\"$programName\")");
+ }
+
//
// Tell mythfrontend that something has changed
//
@@ -146,7 +150,7 @@
function dontRecord($programName, $channel, $start)
{
- $aQuery = mysql_query("delete from allrecord where title = \"$programName\"");
+ $aQuery = mysql_query("delete from allrecord where title = \"$programName\" and chanid is NULL or chanid = $channel ");
$bQuery = mysql_query("delete from singlerecord where chanid = $channel and starttime = \"$start\"");
$cQuery = mysql_query("delete from timeslotrecord where chanid = $channel and starttime = \"$start\" and title = \"$programName\"");
//
@@ -162,7 +166,7 @@
function isInAlwaysRecord($theTitle)
{
- $aQuery = mysql_query("select * from allrecord where title = \"$theTitle\"");
+ $aQuery = mysql_query("select * from allrecord where title = \"$theTitle\" and chanid is NULL");
if(mysql_num_rows($aQuery) > 0)
{
return(TRUE);
Common subdirectories: /data/tmp/mythtv/current/mythweb/images and mythweb/images
diff -u /data/tmp/mythtv/current/mythweb/listings.php mythweb/listings.php
--- /data/tmp/mythtv/current/mythweb/listings.php 2002-12-07 01:25:42.000000000 -0500
+++ mythweb/listings.php 2002-12-07 16:36:47.000000000 -0500
@@ -171,7 +171,8 @@
// always record or a timeslot
// record
//
- if(isInAlwaysRecord($proginfo->title) ||
+ if(isInAlwaysRecord($proginfo->title) ||
+ isInChannelAlwaysRecord($mychannel->chanid, $proginfo->title) ||
isInTimeslotRecord($proginfo->chanid, $proginfo->startts, $proginfo->endts, $proginfo->title))
{
$proginfo->setColours($list_reccolour, $finalColour);
diff -u /data/tmp/mythtv/current/mythweb/single.php mythweb/single.php
--- /data/tmp/mythtv/current/mythweb/single.php 2002-12-07 01:25:42.000000000 -0500
+++ mythweb/single.php 2002-12-07 16:57:08.000000000 -0500
@@ -174,6 +174,7 @@
print("<BR><INPUT TYPE=\"RADIO\" NAME=\"recordsettings\" VALUE=\"NR\" ");
if( $isBeingSingleRecorded == FALSE &&
$isBeingAlwaysRecorded == FALSE &&
+ $isBeingChannelAlwaysRecorded == FALSE &&
$isBeingTimeslotRecorded == FALSE)
{
print("CHECKED ");
--------------Boundary-00=_UYSRA1GMI3P3IRP98FML--