diff recomplete.php @ 146:4afd353b4507

merged with upstream
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Tue, 23 Mar 2010 02:37:31 +0900
parents 481e789605e3
children 5b192e94f49d
line wrap: on
line diff
--- a/recomplete.php	Sun Mar 21 05:51:19 2010 +0900
+++ b/recomplete.php	Tue Mar 23 02:37:31 2010 +0900
@@ -5,6 +5,7 @@
 include_once( $script_path . '/config.php');
 include_once( INSTALL_PATH . "/DBRecord.class.php" );
 include_once( INSTALL_PATH . "/Settings.class.php" );
+include_once( INSTALL_PATH . "/recLog.inc.php" );
 
 $settings = Settings::factory();
 
@@ -12,10 +13,12 @@
 
 try{
 	$rrec = new DBRecord( RESERVE_TBL, "id" , $reserve_id );
+	$rrec->complete = '1';
 	
 	if( file_exists( INSTALL_PATH .$settings->spool . "/". $rrec->path ) ) {
 		// 予約完了
-		$rrec->complete = '1';
+		reclog( "recomplete:: 予約ID". $rrec->id .":".$rrec->type.$rrec->channel.$rrec->title."の録画が完了" );
+		
 		if( $settings->mediatomb_update == 1 ) {
 			// ちょっと待った方が確実っぽい
 			@exec("sync");
@@ -36,10 +39,13 @@
 	}
 	else {
 		// 予約失敗
+		reclog( "recomplete:: 予約ID". $rrec->id .":".$rrec->type.$rrec->channel.$rrec->title."の録画に失敗した模様", E_ERROR );
 		$rrec->delete();
 	}
 }
 catch( exception $e ) {
+	reclog( "recomplete:: 予約テーブルのアクセスに失敗した模様", E_ERROR );
+	reclog( "recomplete:: ".$e->getMessage()."" , E_ERROR );
 	exit( $e->getMessage() );
 }