changeset 82:330c83ae8c95

fix: CSのEPG取得時に予約重複チェックを行っていなかったのを修正
author yoneda <yoneda@recorder.localnet.mda.or.jp>
date Sun, 28 Feb 2010 21:44:16 +0900
parents 322bba0d33e5
children f873e3251487
files getepg.php
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/getepg.php	Thu Feb 25 18:38:09 2010 +0900
+++ b/getepg.php	Sun Feb 28 21:44:16 2010 +0900
@@ -23,9 +23,12 @@
   		storeProgram( "BS", $settings->temp_xml );
   		if( file_exists( $settings->temp_data ) ) @unlink( $settings->temp_data );
   		if( file_exists( $settings->temp_xml ) ) @unlink( $settings->temp_xml );
+	}
 
-		// CS
-		if ($settings->cs_rec_flg != 0) {
+	// CS
+	if ($settings->cs_rec_flg != 0) {
+		$num = DBRecord::countRecords(  RESERVE_TBL, "WHERE complete = '0' AND (type = 'BS' OR type = 'CS') AND endtime > now() AND starttime < addtime( now(), '00:03:05')" );
+		if( $num == 0 ) {
 			$cmdline = "CHANNEL=CS8 DURATION=120 TYPE=CS TUNER=0 MODE=0 OUTPUT=".$settings->temp_data." ".DO_RECORD . " >/dev/null 2>&1";
 			exec( $cmdline );
 			$cmdline = $settings->epgdump." /CS ".$settings->temp_data." ".$settings->temp_xml;
@@ -33,7 +36,9 @@
 			storeProgram( "CS", $settings->temp_xml );
 			if( file_exists( $settings->temp_data ) ) @unlink( $settings->temp_data );
 			if( file_exists( $settings->temp_xml ) ) @unlink( $settings->temp_xml );
-
+		}
+		$num = DBRecord::countRecords(  RESERVE_TBL, "WHERE complete = '0' AND (type = 'BS' OR type = 'CS') AND endtime > now() AND starttime < addtime( now(), '00:03:05')" );
+		if( $num == 0 ) {
 			$cmdline = "CHANNEL=CS24 DURATION=120 TYPE=CS TUNER=0 MODE=0 OUTPUT=".$settings->temp_data." ".DO_RECORD . " >/dev/null 2>&1";
 			exec( $cmdline );
 			$cmdline = $settings->epgdump." /CS ".$settings->temp_data." ".$settings->temp_xml;