diff --git a/getepg.php b/getepg.php index 63e1bde..97ff057 100644 --- a/getepg.php +++ b/getepg.php @@ -123,13 +123,13 @@ function epgrec_exec( $cmd, $env = null ) { // 地上波を処理する if( $settings->gr_tuners != 0 ) { - foreach( $GR_CHANNEL_MAP as $key=>$value ){ + foreach( $GR_CHANNEL_MAP as $value ){ // 録画重複チェック $num = DBRecord::countRecords( RESERVE_TBL, "WHERE complete = '0' AND type = 'GR' AND endtime > now() AND starttime < addtime( now(), '00:01:10')" ); if($num < $settings->gr_tuners && check_file($temp_data_gr.$value."")) { $cmdline = "CHANNEL=".$value." DURATION=60 TYPE=GR TUNER=0 MODE=0 OUTPUT=".$temp_data_gr.$value." ".DO_RECORD . " >/dev/null 2>&1"; exec( $cmdline ); - $cmdline = INSTALL_PATH."/storeProgram.php GR ".$temp_data_gr.$value." ".$key; + $cmdline = INSTALL_PATH."/storeProgram.php GR ".$temp_data_gr.$value." ".$value; $gr_procs[] = epgrec_exec( $cmdline ); } } diff --git a/index.php b/index.php index 2504286..55afaa6 100644 --- a/index.php +++ b/index.php @@ -45,9 +45,11 @@ // 番組表 $programs = array(); -if( $type == "BS" ) $channel_map = $BS_CHANNEL_MAP; -else if( $type == "GR" ) $channel_map = $GR_CHANNEL_MAP; -else if( $type == "CS" ) $channel_map = $CS_CHANNEL_MAP; +$tmprec = new DBRecord(CHANNEL_TBL); +$recarr = $tmprec->fetch_array( "type", $type, "ORDER BY sid ASC " ); +foreach( $recarr as $val) { + $channel_map["$val->channel_disc"] = $val->channel; +} $st = 0; $prec = null; try { diff --git a/settings/site_conf.php b/settings/site_conf.php index da47a3d..49265be 100644 --- a/settings/site_conf.php +++ b/settings/site_conf.php @@ -11,4 +11,13 @@ 'suffix' => '.ts', // do-record.shのカスタマイズが必要 ), ); +// 識別子 => チャンネル番号 +$GR_CHANNEL_MAP = array( + "GR15" => "15", // NHK + "GR13" => "13", // 教育 + "GR26" => "26", // テレビ新潟 + "GR23" => "23", // 新潟テレビ21 + "GR17" => "17", // 新潟放送 + "GR19" => "19", // 新潟総合テレビ +); ?> diff --git a/storeProgram.php b/storeProgram.php index 9a84f50..0141655 100644 --- a/storeProgram.php +++ b/storeProgram.php @@ -25,9 +25,9 @@ $cmdline = $settings->epgdump." "; if( $type === "GR" ) { - $key = $argv[3]; // key - $xmlfile = $settings->temp_xml.$key.""; - $cmdline .= $key." ".$file." ".$xmlfile; + $ch = $argv[3]; // channel + $xmlfile = $settings->temp_xml."_gr".$ch; + $cmdline .= $ch." ".$file." ".$xmlfile; } else if( $type === "CS1" ) { $type = "CS";