[mythtv] PATCH for MythWeb to allow unsuppressing a recording

jasonmiller at micron.com jasonmiller at micron.com
Wed May 14 11:39:54 EDT 2003


This patch adds an Activate button next to suppressed (Yellow) programs in the MythWeb FixConflicts page.  All it does is delete the entry for that program from oldrecorded which should have the effect of allowing that program to either be recorded or be in conflict in which case it can then be resolved the normal way.  If there is a gotcha in doing it this way let me know :)


Index: mythweb/conflicts.php
===================================================================
RCS file: /var/lib/mythcvs/mythweb/conflicts.php,v
retrieving revision 1.4
diff -u -r1.4 conflicts.php
--- mythweb/conflicts.php	4 May 2003 00:51:11 -0000	1.4
+++ mythweb/conflicts.php	14 May 2003 16:33:45 -0000
@@ -16,6 +16,14 @@
 //	conflicts (e.g. Middle East)
 //
 
+if ($_POST['makeunmasked'] && $_POST['chanid'] && $_POST['starttime'] && $_POST['endtime'])
+{
+    $chanid = urldecode($_POST['chanid']);
+    $starttime = formatConflictTime(urldecode($_POST['starttime']));
+    $endtime = formatConflictTime(urldecode($_POST['endtime']));
+    makeUnmasked($chanid,$starttime,$endtime);
+}
+
 if ($_POST['makeactive'] && $_POST['chanid'] && $_POST['starttime'] && $_POST['endtime'])
 {
     $chanid = urldecode($_POST['chanid']);
@@ -92,10 +100,11 @@
 	if($color == "#FFFF00")
 	   {
    	      print "<form action=\"main.php?mode=conflicts\" method=\"post\">";
-              print  "<input type=\"hidden\" name=\"makeactive\" value=\"1\">";
+              print  "<input type=\"hidden\" name=\"makeunmasked\" value=\"1\">";
               print  "<input type=\"hidden\" name=\"chanid\" value=\"".urlencode($recs[$t][4]). "\">";
               print  "<input type=\"hidden\" name=\"starttime\" value=\"".urlencode($recs[$t][11]). "\">";
               print  "<input type=\"hidden\" name=\"endtime\" value=\"".urlencode($recs[$t][12]). "\">";
+	      print "<TD><input type=\"submit\" name=\"activatebutton\" value=\"Activate\"></TD></form>";
 	   }
         print "</TR>\n";
     }
Index: mythweb/functions.php
===================================================================
RCS file: /var/lib/mythcvs/mythweb/functions.php,v
retrieving revision 1.13
diff -u -r1.13 functions.php
--- mythweb/functions.php	9 May 2003 16:19:54 -0000	1.13
+++ mythweb/functions.php	14 May 2003 16:33:48 -0000
@@ -962,6 +962,13 @@
 	return strtotime("$dom $mon $year $time");
 }
 
+function makeUnmasked($chanid,$starttime,$endtime) {
+    $theQuery = "SELECT chanid,title,subtitle,description FROM program WHERE chanid='$chanid' AND starttime='$starttime' AND endtime='$endtime'";
+    $program = mysql_fetch_row(mysql_query($theQuery));
+    $theQuery = 'DELETE FROM oldrecorded WHERE title="' . $program[1] . '" AND subtitle="' . $program[2] . '" AND description="' . $program[3] . '"';
+    $result = mysql_query($theQuery);
+}
+
 function makeActive($chanid,$starttime,$endtime) {
     $theQuery = "SELECT preferchanid,preferstarttime,preferendtime FROM conflictresolutionsingle WHERE dislikechanid='$chanid' AND dislikestarttime='$starttime' AND dislikeendtime='$endtime'";
     $oldConflict = mysql_fetch_row(mysql_query($theQuery));




More information about the mythtv-dev mailing list