チェンジセット 94: trunk/install/perl/addpidatq.pl
- コミット日時:
- 2010/02/28 22:28:26 (15 年前)
- ファイル:
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
trunk/install/perl/addpidatq.pl
r83 r94 14 14 use DBI; 15 15 use DBD::Pg; 16 use DBD::SQLite; 16 17 use Schedule::At; 17 18 use Time::Local; … … 19 20 $path = $0; 20 21 $path =~ s/addpidatq.pl$//i; 21 if ($p wdne "./"){22 if ($path ne "./"){ 22 23 push( @INC, "$path"); 23 24 } … … 36 37 37 38 #DB検索(PID) 38 my $data_source = sprintf("dbi:%s:dbname=%s;host=%s;port=%d", 39 $DBDriv,$DBName,$DBHost,$DBPort); 40 $dbh = DBI->connect($data_source,$DBUser,$DBPass) ||die $DBI::error;; 39 $dbh = DBI->connect($DSN,$DBUser,$DBPass) ||die $DBI::error;; 41 40 42 $DBQuery = "SELECT count(*) FROM foltia_subtitle WHERE pid = '$pid' "; 43 $sth = $dbh->prepare($DBQuery); 44 $sth->execute(); 41 $sth = $dbh->prepare($stmt{'addpidatq.1'}); 42 $sth->execute($pid); 45 43 @titlecount= $sth->fetchrow_array; 46 44 47 45 if ($titlecount[0] == 1 ){ 48 49 $DBQuery = "SELECT bitrate,digital FROM foltia_tvrecord , foltia_subtitle WHERE foltia_tvrecord.tid = foltia_subtitle.tid AND pid='$pid' "; 50 $sth = $dbh->prepare($DBQuery); 51 $sth->execute(); 46 $sth = $dbh->prepare($stmt{'addpidatq.2'}); 47 $sth->execute($pid); 52 48 @titlecount= $sth->fetchrow_array; 53 49 $bitrate = $titlecount[0];#ビットレート取得 … … 59 55 60 56 #PID抽出 61 $now = &epoch2foldate(`date +%s`);57 $now = &epoch2foldate(time()); 62 58 63 59 #stationIDからrecch 64 $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 "; 65 66 $stationh = $dbh->prepare($DBQuery); 67 $stationh->execute(); 68 @stationl = $stationh->fetchrow_array; 60 $stationh = $dbh->prepare($stmt{'addpidatq.3'}); 61 $stationh->execute($pid); 62 @stationl = $stationh->fetchrow_array(); 69 63 $recch = $stationl[0]; 70 64 if ($recch eq ""){ 71 &writelog("addpidatq ERROR recch is NULL:$ DBQuery.");65 &writelog("addpidatq ERROR recch is NULL:$stmt{'addpidatq.3'}."); 72 66 exit 1; 73 67 } … … 82 76 $digitalstationband = 0; 83 77 } 84 $DBQuery = "SELECT * FROM foltia_subtitle WHERE pid='$pid' "; 85 $sth = $dbh->prepare($DBQuery); 86 $sth->execute(); 78 $sth = $dbh->prepare($stmt{'addpidatq.4'}); 79 $sth->execute($pid); 87 80 ($pid , 88 81 $tid ,