[mythtv] patch: movies, years/stars/ratings

Andy Davidoff dert at pobox.com
Sat Mar 8 19:15:07 EST 2003


A simple fix to let users specify movie channels to ignore on a
source-by-source basis, eg. if using antenna/cable/satellite.
-------------- next part --------------
Index: mythweb/functions.php
===================================================================
RCS file: /var/lib/cvs/mythweb/functions.php,v
retrieving revision 1.14
diff -d -u -w -r1.14 functions.php
--- mythweb/functions.php	8 Mar 2003 04:15:41 -0000	1.14
+++ mythweb/functions.php	9 Mar 2003 00:13:16 -0000
@@ -457,13 +457,39 @@
 	$maxStars = $GLOBALS['maximumStarRating'];
 	$star = $GLOBALS['starRatingCharacter'];
 
-	foreach ($ppv_channels as $start => $stop)
+	if (count($ppv_channels) > 0)
 	{
-		$ignore .= "AND ";
+		foreach ($ppv_channels as $hostname => $capturecards)
+		{
+			foreach ($capturecards as $card => $input)
+			{
+				foreach ($input as $inputname => $channels)
+				{
+					$source = singleSelect("select ".
+								"capturecard.videodevice, ".
+								"cardinput.inputname, ".
+								"cardinput.sourceid as 'id' ".
+							"from capturecard left join cardinput using (cardid) ".
+							"where capturecard.videodevice = \"$card\" and ".
+								"cardinput.inputname = \"$inputname\" and ".
+								"capturecard.hostname = \"$hostname\";");
+					foreach ($channels as $start => $stop)
+					{
+						$ignore .= "and ";
 		if ((int) $start && (int) $stop)
-			$ignore .= "channel.channum not between $start and $stop ";
+						{
+							$ignore .= "(channel.sourceid != ".$source['id'].
+							" or channel.channum not between $start and $stop) ";
+						}
 		else
-			$ignore .= "channel.channum not in (\"$start\", \"$stop\") ";
+						{
+							$ignore .= "(channel.sourceid != ".$source['id'].
+							" or channel.channum not in (\"$start\", \"$stop\")) ";
+						}
+					}
+				}
+			}
+		}
 	}
 
 	$query = "SELECT ".
Index: mythweb/settings.php
===================================================================
RCS file: /var/lib/cvs/mythweb/settings.php,v
retrieving revision 1.7
diff -d -u -w -r1.7 settings.php
--- mythweb/settings.php	7 Mar 2003 19:35:49 -0000	1.7
+++ mythweb/settings.php	9 Mar 2003 00:13:16 -0000
@@ -57,7 +57,14 @@
 	//	"FOO1"	=>	"BAR2",
 	//	"ZIP3"	=>	"ZAP4",
 	$ignore_movie_channels = array(
+//		"somehostname"	=>	array(
+//			"/dev/video0"	=>	array(
+//				"Television"	=>	array(
+//					100	=>	200,
-		401	=>	432,
+//		401	=>	432,
+//				),
+//			),
+//		),
 	);
 
 	//


More information about the mythtv-dev mailing list