Mercurial > epgrec.yaz
comparison recomplete.php @ 142:481e789605e3
mod: EPG???????????????????????????????
| author | epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp> |
|---|---|
| date | Sun, 21 Mar 2010 16:42:58 +0900 |
| parents | 3bed74eca373 |
| children | 5b192e94f49d |
comparison
equal
deleted
inserted
replaced
| 136:6754b6aa50cf | 142:481e789605e3 |
|---|---|
| 3 $script_path = dirname( __FILE__ ); | 3 $script_path = dirname( __FILE__ ); |
| 4 chdir( $script_path ); | 4 chdir( $script_path ); |
| 5 include_once( $script_path . '/config.php'); | 5 include_once( $script_path . '/config.php'); |
| 6 include_once( INSTALL_PATH . "/DBRecord.class.php" ); | 6 include_once( INSTALL_PATH . "/DBRecord.class.php" ); |
| 7 include_once( INSTALL_PATH . "/Settings.class.php" ); | 7 include_once( INSTALL_PATH . "/Settings.class.php" ); |
| 8 include_once( INSTALL_PATH . "/recLog.inc.php" ); | |
| 8 | 9 |
| 9 $settings = Settings::factory(); | 10 $settings = Settings::factory(); |
| 10 | 11 |
| 11 $reserve_id = $argv[1]; | 12 $reserve_id = $argv[1]; |
| 12 | 13 |
| 13 try{ | 14 try{ |
| 14 $rrec = new DBRecord( RESERVE_TBL, "id" , $reserve_id ); | 15 $rrec = new DBRecord( RESERVE_TBL, "id" , $reserve_id ); |
| 16 $rrec->complete = '1'; | |
| 15 | 17 |
| 16 if( file_exists( INSTALL_PATH .$settings->spool . "/". $rrec->path ) ) { | 18 if( file_exists( INSTALL_PATH .$settings->spool . "/". $rrec->path ) ) { |
| 17 // 予約完了 | 19 // 予約完了 |
| 18 $rrec->complete = '1'; | 20 reclog( "recomplete:: 予約ID". $rrec->id .":".$rrec->type.$rrec->channel.$rrec->title."の録画が完了" ); |
| 21 | |
| 19 if( $settings->mediatomb_update == 1 ) { | 22 if( $settings->mediatomb_update == 1 ) { |
| 20 // ちょっと待った方が確実っぽい | 23 // ちょっと待った方が確実っぽい |
| 21 @exec("sync"); | 24 @exec("sync"); |
| 22 sleep(15); | 25 sleep(15); |
| 23 $dbh = mysql_connect( $settings->db_host, $settings->db_user, $settings->db_pass ); | 26 $dbh = mysql_connect( $settings->db_host, $settings->db_user, $settings->db_pass ); |
| 34 } | 37 } |
| 35 } | 38 } |
| 36 } | 39 } |
| 37 else { | 40 else { |
| 38 // 予約失敗 | 41 // 予約失敗 |
| 42 reclog( "recomplete:: 予約ID". $rrec->id .":".$rrec->type.$rrec->channel.$rrec->title."の録画に失敗した模様", E_ERROR ); | |
| 39 $rrec->delete(); | 43 $rrec->delete(); |
| 40 } | 44 } |
| 41 } | 45 } |
| 42 catch( exception $e ) { | 46 catch( exception $e ) { |
| 47 reclog( "recomplete:: 予約テーブルのアクセスに失敗した模様", E_ERROR ); | |
| 48 reclog( "recomplete:: ".$e->getMessage()."" , E_ERROR ); | |
| 43 exit( $e->getMessage() ); | 49 exit( $e->getMessage() ); |
| 44 } | 50 } |
| 45 | 51 |
| 46 ?> | 52 ?> |
