Mercurial > epgrec.yaz
diff storeProgram.php @ 93:80cc05b420af
fix: $*_CHANNEL_MAP???????????????????????????
| author | epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp> |
|---|---|
| date | Tue, 02 Mar 2010 23:21:17 +0900 |
| parents | f873e3251487 |
| children | 12ed8ad837fc |
line wrap: on
line diff
--- a/storeProgram.php Tue Mar 02 17:42:30 2010 +0900 +++ b/storeProgram.php Tue Mar 02 23:21:17 2010 +0900 @@ -87,12 +87,14 @@ // チャンネルデータを探す $num = DBRecord::countRecords( CHANNEL_TBL , "WHERE channel_disc = '" . $disc ."'" ); if( $num == 0 ) { - // チャンネルデータがないなら新規作成 - $rec = new DBRecord( CHANNEL_TBL ); - $rec->type = $type; - $rec->channel = $map["$disc"]; - $rec->channel_disc = $disc; - $rec->name = $ch->{'display-name'}; + if( array_key_exists( $disc, $map ) ) { + // チャンネルデータがないなら新規作成 + $rec = new DBRecord( CHANNEL_TBL ); + $rec->type = $type; + $rec->channel = $map["$disc"]; + $rec->channel_disc = $disc; + $rec->name = $ch->{'display-name'}; + } } else { // 存在した場合も、とりあえずチャンネル名は更新する @@ -110,6 +112,8 @@ foreach( $xml->programme as $program ) { $channel_disc = $program['channel']; + if( ! array_key_exists( $channel_disc, $map ) ) continue; + $channel = $map["$channel_disc"]; $starttime = str_replace(" +0900", '', $program['start'] ); $endtime = str_replace( " +0900", '', $program['stop'] );
