changeset 163:b3095425e613

fix: 録画中にEPGの変更があったときにキャンセルされないよう変更
author epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
date Sun, 04 Apr 2010 22:49:13 +0900
parents c6c6bd734f18
children 254d8a21bf36
files recorder.php storeProgram.inc.php
diffstat 2 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/recorder.php	Sun Apr 04 18:14:47 2010 +0900
+++ b/recorder.php	Sun Apr 04 22:49:13 2010 +0900
@@ -156,6 +156,7 @@
 	
 	$proch = false;
 	if( ( $proch = epgrec_exec(DO_RECORD) ) !== false ) {
+		reclog("recorder:: 牙ID".$rrec->id .":".$rrec->type.$rrec->channel.$rrec->title."牙脂紮" );
 		// 牙糸篋緇
 		$rec_cont = true;
 		while( $rec_cont ){
@@ -195,7 +196,6 @@
 	}
 	
 	// 篋絎腟篋憜吾
-	
 	if( time() < $endtime ) {
 		$rrec->endtime = toDatetime( time() );
 	}
--- a/storeProgram.inc.php	Sun Apr 04 18:14:47 2010 +0900
+++ b/storeProgram.inc.php	Sun Apr 04 22:49:13 2010 +0900
@@ -1,4 +1,5 @@
 <?php
+include_once( INSTALL_PATH . "/reclib.php" );
 
 function garbageClean() {
 	// 筝荀違
@@ -25,7 +26,6 @@
 	foreach( $arr as $val ) {
 		try {
 			$val->reservation();
-//			reclog( "getepg::若若ID".$val->id."牙祉篋膣");
 		}
 		catch( Exception $e ) {
 			// ∴
@@ -35,6 +35,7 @@
 
 function storeProgram( $type, $xmlfile ) {
 	global $BS_CHANNEL_MAP, $GR_CHANNEL_MAP, $CS_CHANNEL_MAP;
+	global $settings;
 	
 	// c潟<ゃ羣
 	$map = array();
@@ -149,9 +150,15 @@
 						// 牙私膣腟丈紊眼cゃ
 						try {
 							$reserve = new DBRecord(RESERVE_TBL, "program_id", $rec->id );
-							if( $reserve->autorec ) {
-								reclog( "getepg::牙ID".$reserve->id.":".$reserve->type.$reserve->channel.$reserve->title."紊眼醇с篋膣羔" );
-								Reservation::cancel( $reserve->id );
+							// с紮牙祉∴
+							if( time() > (toTimestamp($reserve->starttime) - PADDING_TIME - $settings->former_time) ) {
+								reclog( "getepg::牙ID".$reserve->id.":".$reserve->type.$reserve->channel.$reserve->title."牙脂紮緇紊眼榊醇с", EPGREC_WARN );
+							}
+							else {
+								if( $reserve->autorec ) {
+									reclog( "getepg::牙ID".$reserve->id.":".$reserve->type.$reserve->channel.$reserve->title."紊眼醇с篋膣羔" );
+									Reservation::cancel( $reserve->id );
+								}
 							}
 						}
 						catch( Exception $e ) {