# HG changeset patch # User Yoshiki Yazawa # Date 1269778156 -32400 # Node ID 43f74519bd520c4da357d2fab951ac10353e732b # Parent 3a6ec345ab0cb686761ad07e8e03003b37272853 more relaxed tuner occupation check diff -r 3a6ec345ab0c -r 43f74519bd52 getepg.old.php --- a/getepg.old.php Sat Mar 27 23:21:25 2010 +0900 +++ b/getepg.old.php Sun Mar 28 21:09:16 2010 +0900 @@ -19,7 +19,7 @@ if( $settings->bs_tuners != 0 ) { // 録画重複チェック $num = DBRecord::countRecords( RESERVE_TBL, "WHERE complete = '0' AND (type = 'BS' OR type = 'CS') AND endtime > now() AND starttime < addtime( now(), '00:03:05')" ); - if( $num == 0 ) { + if( $num < $settings->bs_tuners ) { $cmdline = "CHANNEL=211 DURATION=180 TYPE=BS TUNER=0 MODE=0 OUTPUT=".$settings->temp_data." ".DO_RECORD . " >/dev/null 2>&1"; exec( $cmdline ); $cmdline = $settings->epgdump." /BS ".$settings->temp_data." ".$settings->temp_xml; @@ -32,7 +32,7 @@ // CS if ($settings->cs_rec_flg != 0) { $num = DBRecord::countRecords( RESERVE_TBL, "WHERE complete = '0' AND (type = 'BS' OR type = 'CS') AND endtime > now() AND starttime < addtime( now(), '00:03:05')" ); - if( $num == 0 ) { + if( $num < $settings->bs_tuners ) { $cmdline = "CHANNEL=CS8 DURATION=120 TYPE=CS TUNER=0 MODE=0 OUTPUT=".$settings->temp_data." ".DO_RECORD . " >/dev/null 2>&1"; exec( $cmdline ); $cmdline = $settings->epgdump." /CS ".$settings->temp_data." ".$settings->temp_xml; @@ -42,7 +42,7 @@ if( file_exists( $settings->temp_xml ) ) @unlink( $settings->temp_xml ); } $num = DBRecord::countRecords( RESERVE_TBL, "WHERE complete = '0' AND (type = 'BS' OR type = 'CS') AND endtime > now() AND starttime < addtime( now(), '00:03:05')" ); - if( $num == 0 ) { + if( $num < $settings->bs_tuners ) { $cmdline = "CHANNEL=CS24 DURATION=120 TYPE=CS TUNER=0 MODE=0 OUTPUT=".$settings->temp_data." ".DO_RECORD . " >/dev/null 2>&1"; exec( $cmdline ); $cmdline = $settings->epgdump." /CS ".$settings->temp_data." ".$settings->temp_xml; @@ -59,7 +59,7 @@ foreach( $GR_CHANNEL_MAP as $key=>$value ){ // 録画重複チェック $num = DBRecord::countRecords( RESERVE_TBL, "WHERE complete = '0' AND type = 'GR' AND endtime > now() AND starttime < addtime( now(), '00:01:10')" ); - if( $num == 0 ) { + if( $num < $settings->gr_tuners ) { $cmdline = "CHANNEL=".$value." DURATION=60 TYPE=GR TUNER=0 MODE=0 OUTPUT=".$settings->temp_data." ".DO_RECORD . " >/dev/null 2>&1"; exec( $cmdline ); $cmdline = $settings->epgdump." ".$key." ".$settings->temp_data." ".$settings->temp_xml; diff -r 3a6ec345ab0c -r 43f74519bd52 getepg.php --- a/getepg.php Sat Mar 27 23:21:25 2010 +0900 +++ b/getepg.php Sun Mar 28 21:09:16 2010 +0900 @@ -87,7 +87,7 @@ if( file_exists( $settings->temp_data ) ) @unlink( $settings->temp_data ); } $num = DBRecord::countRecords( RESERVE_TBL, "WHERE complete = '0' AND (type = 'BS' OR type = 'CS') AND endtime > now() AND starttime < addtime( now(), '00:03:05')" ); - if( ($num == 0) && check_file($temp_xml_cs2) ) { + if( ($num < $settings->bs_tuners) && check_file($temp_xml_cs2) ) { $cmdline = "CHANNEL=".CS2_EPG_CHANNEL." DURATION=120 TYPE=CS TUNER=0 MODE=0 OUTPUT=".$settings->temp_data." ".DO_RECORD . " >/dev/null 2>&1"; exec( $cmdline ); $cmdline = $settings->epgdump." /CS ".$settings->temp_data." ".$temp_xml_cs2;