Index: trunk/install/perl/addpidatq.pl =================================================================== --- trunk/install/perl/addpidatq.pl (リビジョン 1) +++ trunk/install/perl/addpidatq.pl (リビジョン 83) @@ -47,22 +47,39 @@ if ($titlecount[0] == 1 ){ -$DBQuery = "SELECT bitrate FROM foltia_tvrecord , foltia_subtitle WHERE foltia_tvrecord.tid = foltia_subtitle.tid AND pid='$pid' "; +$DBQuery = "SELECT bitrate,digital FROM foltia_tvrecord , foltia_subtitle WHERE foltia_tvrecord.tid = foltia_subtitle.tid AND pid='$pid' "; $sth = $dbh->prepare($DBQuery); $sth->execute(); @titlecount= $sth->fetchrow_array; $bitrate = $titlecount[0];#ビットレート取得 +if ($titlecount[1] >= 1){ + $usedigital = $titlecount[1];#デジタル優先フラグ +}else{ + $usedigital = 0; +} #PID抽出 $now = &epoch2foldate(`date +%s`); -$DBQuery = "SELECT stationrecch FROM foltia_station,foltia_subtitle WHERE foltia_subtitle.pid = '$pid' AND foltia_subtitle.stationid = foltia_station.stationid "; +#stationIDからrecch +$DBQuery = "SELECT stationrecch,digitalch ,digitalstationband ,foltia_station.stationid FROM foltia_station,foltia_subtitle WHERE foltia_subtitle.pid = '$pid' AND foltia_subtitle.stationid = foltia_station.stationid "; - -#stationIDからrecch $stationh = $dbh->prepare($DBQuery); $stationh->execute(); @stationl = $stationh->fetchrow_array; $recch = $stationl[0]; - +if ($recch eq ""){ + &writelog("addpidatq ERROR recch is NULL:$DBQuery."); + exit 1; +} +if ($stationl[1] => 1){ + $digitalch = $stationl[1]; +}else{ + $digitalch = 0; +} +if ($stationl[2] => 1){ + $digitalstationband = $stationl[2]; +}else{ + $digitalstationband = 0; +} $DBQuery = "SELECT * FROM foltia_subtitle WHERE pid='$pid' "; $sth = $dbh->prepare($DBQuery); @@ -109,11 +126,11 @@ } -Schedule::At::add (TIME => "$atdateparam", COMMAND => "$toolpath/perl/recwrap.pl $recch $reclength $bitrate $tid $countno $pid" , TAG => "$pid"."_R"); - &writelog("addpidatq TIME $atdateparam COMMAND $toolpath/perl/recwrap.pl $recch $reclength $bitrate $tid $countno $pid"); +Schedule::At::add (TIME => "$atdateparam", COMMAND => "$toolpath/perl/recwrap.pl $recch $reclength $bitrate $tid $countno $pid $stationid $usedigital $digitalstationband $digitalch" , TAG => "$pid"."_R"); + &writelog("addpidatq TIME $atdateparam COMMAND $toolpath/perl/recwrap.pl $recch $reclength $bitrate $tid $countno $pid $stationid $usedigital $digitalstationband $digitalch"); }#end #もし新開始時刻が15分移譲先なら再キュー }else{ -&writelog("addpidatq drop:expire $pid $startafter $now $startdatetime"); +&writelog("addpidatq drop:expire $pid $startafter $now $startdatetime"); }#放送が未来の日付なら