Skip to content

Commit

Permalink
チャンネルマップ自動取得に伴う修正
Browse files Browse the repository at this point in the history
  • Loading branch information
stz2012 committed Aug 3, 2012
1 parent 4045db8 commit 2ba0864
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
4 changes: 2 additions & 2 deletions getepg.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
}
Expand Down
8 changes: 5 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
9 changes: 9 additions & 0 deletions settings/site_conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -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", // 新潟総合テレビ
);
?>
6 changes: 3 additions & 3 deletions storeProgram.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 2ba0864

Please sign in to comment.