comparison storeProgram.inc.php @ 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 5b192e94f49d
children e379552d084c
comparison
equal deleted inserted replaced
162:c6c6bd734f18 163:b3095425e613
1 <?php 1 <?php
2 include_once( INSTALL_PATH . "/reclib.php" );
2 3
3 function garbageClean() { 4 function garbageClean() {
4 // 筝荀違 5 // 筝荀違
5 // 8ヤ札筝違羔 6 // 8ヤ札筝違羔
6 $arr = array(); 7 $arr = array();
23 $arr = array(); 24 $arr = array();
24 $arr = Keyword::createKeywords(); 25 $arr = Keyword::createKeywords();
25 foreach( $arr as $val ) { 26 foreach( $arr as $val ) {
26 try { 27 try {
27 $val->reservation(); 28 $val->reservation();
28 // reclog( "getepg::若若ID".$val->id."牙祉篋膣");
29 } 29 }
30 catch( Exception $e ) { 30 catch( Exception $e ) {
31 // ∴ 31 // ∴
32 } 32 }
33 } 33 }
34 } 34 }
35 35
36 function storeProgram( $type, $xmlfile ) { 36 function storeProgram( $type, $xmlfile ) {
37 global $BS_CHANNEL_MAP, $GR_CHANNEL_MAP, $CS_CHANNEL_MAP; 37 global $BS_CHANNEL_MAP, $GR_CHANNEL_MAP, $CS_CHANNEL_MAP;
38 global $settings;
38 39
39 // c潟<ゃ羣 40 // c潟<ゃ羣
40 $map = array(); 41 $map = array();
41 if( $type == "BS" ) $map = $BS_CHANNEL_MAP; 42 if( $type == "BS" ) $map = $BS_CHANNEL_MAP;
42 else if( $type == "GR") $map = $GR_CHANNEL_MAP; 43 else if( $type == "GR") $map = $GR_CHANNEL_MAP;
147 $records = DBRecord::createRecords(PROGRAM_TBL, $options); 148 $records = DBRecord::createRecords(PROGRAM_TBL, $options);
148 foreach( $records as $rec ) { 149 foreach( $records as $rec ) {
149 // 牙私膣腟丈紊眼cゃ 150 // 牙私膣腟丈紊眼cゃ
150 try { 151 try {
151 $reserve = new DBRecord(RESERVE_TBL, "program_id", $rec->id ); 152 $reserve = new DBRecord(RESERVE_TBL, "program_id", $rec->id );
152 if( $reserve->autorec ) { 153 // с紮牙祉∴
153 reclog( "getepg::牙ID".$reserve->id.":".$reserve->type.$reserve->channel.$reserve->title."紊眼醇с篋膣羔" ); 154 if( time() > (toTimestamp($reserve->starttime) - PADDING_TIME - $settings->former_time) ) {
154 Reservation::cancel( $reserve->id ); 155 reclog( "getepg::牙ID".$reserve->id.":".$reserve->type.$reserve->channel.$reserve->title."牙脂紮緇紊眼榊醇с", EPGREC_WARN );
156 }
157 else {
158 if( $reserve->autorec ) {
159 reclog( "getepg::牙ID".$reserve->id.":".$reserve->type.$reserve->channel.$reserve->title."紊眼醇с篋膣羔" );
160 Reservation::cancel( $reserve->id );
161 }
155 } 162 }
156 } 163 }
157 catch( Exception $e ) { 164 catch( Exception $e ) {
158 // ∴ 165 // ∴
159 } 166 }