Mercurial > epgrec.yaz
changeset 92:e2c37cc736db
merged with upstream
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Tue, 02 Mar 2010 23:20:06 +0900 |
parents | f6b909678e51 (diff) 057ca53de6ca (current diff) |
children | b0095925b3da |
files | Reservation.class.php |
diffstat | 1 files changed, 7 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/Reservation.class.php Tue Mar 02 23:05:53 2010 +0900 +++ b/Reservation.class.php Tue Mar 02 23:20:06 2010 +0900 @@ -78,8 +78,10 @@ // 既存予約数 = TUNER番号 $tuners = ($crec->type == "GR") ? $settings->gr_tuners : $settings->bs_tuners; + $type_str = ($crec->type == "GR") ? "type = 'GR' " : "(type = 'BS' OR type = 'CS') "; + $battings = DBRecord::countRecords( RESERVE_TBL, "WHERE complete = '0' ". - "AND type = '".$crec->type."' ". + "AND ".$type_str. "AND starttime < '".toDatetime($end_time) ."' ". "AND endtime > '".toDatetime($rec_start)."'" ); @@ -90,11 +92,11 @@ // 解消可能な重複かどうかを調べる // 前後の予約数 $nexts = DBRecord::countRecords( RESERVE_TBL, "WHERE complete = '0' ". - "AND type = '".$crec->type."' ". + "AND ".$type_str. "AND starttime = '".toDatetime($end_time - $settings->former_time)."'"); $prevs = DBRecord::countRecords( RESERVE_TBL, "WHERE complete = '0' ". - "AND type = '".$crec->type."' ". + "AND ".$type_str. "AND endtime = '".$starttime."'" ); // 前後を引いてもチューナー数と同数以上なら重複の解消は無理 @@ -111,7 +113,7 @@ // 直前の録画予約を見付ける $trecs = DBRecord::createRecords(RESERVE_TBL, "WHERE complete = '0' ". - "AND type = '".$crec->type."' ". + "AND ".$type_str. "AND endtime = '".$starttime."'" ); // 直前の番組をずらす for( $i = 0; $i < count($trecs) ; $i++ ) { @@ -182,7 +184,7 @@ %TITLE% 番組タイトル %ST% 開始日時(ex.200907201830) %ET% 終了日時 - %TYPE% GR/BS + %TYPE% GR/BS/CS %CH% チャンネル番号 %DOW% 曜日(Sun-Mon) %DOWJ% 曜日(日-土)