チェンジセット 122: trunk/install/perl
- コミット日時:
- 2010/10/07 10:43:38 (14 年前)
- ファイル:
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
trunk/install/perl/db/Pg.pl
r121 r122 74 74 75 75 'xmltv2foltia.replaceepg.1' => "SELECT * FROM foltia_epg WHERE enddatetime > ? AND startdatetime < ? AND ontvchannel = ? AND startdatetime > ?", 76 'xmltv2foltia.replaceepg.2' => "SELECT * FROM foltia_epg WHERE startdatetime = ? AND enddatetime = ? AND ontvchannel = ? ", 76 77 'xmltv2foltia.commitdb.1' => "DELETE FROM foltia_epg WHERE epgid = ?", 77 78 'xmltv2foltia.commitdb.2' => "INSERT INTO foltia_epg VALUES ( nextval('foltia_epg_epgid_seq'), ?, ?, ?, ?, ?, ?, ?)" , trunk/install/perl/xmltv2foltia.pl
r121 r122 127 127 chomp(); 128 128 $item{title} = &removetag($_); 129 $item{title} =~ s/【.* 】//g;#【解】とか130 $item{title} =~ s/\[.* \]//g;#[二]とか129 $item{title} =~ s/【.*?】//g;#【解】とか 130 $item{title} =~ s/\[.*?\]//g;#[二]とか 131 131 #print Dumper($_) ; 132 132 #print "$result \n"; … … 232 232 #&writelog("xmltv2foltia DEBUG push(\@deleteepgid,$data[0]);"); 233 233 }#end while 234 235 #上書きを消す 236 $sth = $dbh->prepare($stmt{'xmltv2foltia.replaceepg.2'}); 237 $sth->execute($foltiastarttime , $foltiaendtime , $ontvepgchannel); 238 while (@data = $sth->fetchrow_array()) { 239 push(@deleteepgid,$data[0]); 240 #&writelog("xmltv2foltia DEBUG push(\@deleteepgid,$data[0]);"); 241 }#end while 242 234 243 }#endsub replaceepg 235 244 … … 241 250 my $desc = $_[4]; 242 251 my $category = $_[5]; 252 253 #Encode::JP::H2Z::z2h(\$string); 254 $title = jcode($title)->tr('A-Za-z0-9!#$%&()*+,−./:;<=>?@[\]^_`{|}','A-Za-z0-9!#$%&()*+,-./:;<=>?@[\]^_`{|}'); 255 $desc = jcode($desc)->tr('A-Za-z0-9!#$%&()*+,−./:;<=>?@[\]^_`{|}','A-Za-z0-9!#$%&()*+,-./:;<=>?@[\]^_`{|}'); 243 256 244 257 #&writelog("xmltv2foltia DEBUG $foltiastarttime:$foltiaendtime"); … … 288 301 $sth = $dbh->prepare($stmt{'xmltv2foltia.commitdb.1'}); 289 302 $sth->execute( $delid ) || warn "$delid\n"; 290 # &writelog("xmltv2foltia DEBUG : DELETE FROM foltia_epg WHERE epgid =$delid");303 #&writelog("xmltv2foltia DEBUG $stmt{'xmltv2foltia.commitdb.1'}/$delid"); 291 304 } 292 305 #追加 … … 294 307 $sth = $dbh->prepare($stmt{'xmltv2foltia.commitdb.2'}); 295 308 $sth->execute( $foltiastarttime[$i],$foltiaendtime[$i], $lengthmin[$i], $channel[$i], $title[$i], $desc[$i], $category[$i]) || warn "error: $foltiastarttime, $foltiaendtime, $lengthmin, $channel, $title, $desc, $category\n"; 296 #&writelog("xmltv2foltia DEBUG : INSERT INTO foltia_epg VALUES ( NULL , $foltiastarttime[$i],$foltiaendtime[$i], $lengthmin[$i], $channel[$i], $title[$i], $desc[$i], $category[$i])");309 #&writelog("xmltv2foltia DEBUG $stmt{'xmltv2foltia.commitdb.2'}/$foltiastarttime[$i],$foltiaendtime[$i], $lengthmin[$i], $channel[$i], $title[$i], $desc[$i], $category[$i]"); 297 310 }# end for 298 311 $dbh->commit;