チェンジセット 122: trunk/install/perl

差分発生行の前後
無視リスト:
コミット日時:
2010/10/07 10:43:38 (14 年前)
コミッタ:
sorshi
ログメッセージ:

EPGのDB格納形式を全角英数から半角英数に変更。
EPGタイトルが消えてしまう不具合修正。
DBへ重複登録されてしまう不具合を修正。

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • trunk/install/perl/db/Pg.pl

    r121 r122  
    7474 
    7575'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 = ? ", 
    7677'xmltv2foltia.commitdb.1' => "DELETE FROM foltia_epg WHERE epgid = ?", 
    7778'xmltv2foltia.commitdb.2' => "INSERT INTO foltia_epg VALUES ( nextval('foltia_epg_epgid_seq'), ?, ?, ?, ?, ?, ?, ?)" , 
  • trunk/install/perl/xmltv2foltia.pl

    r121 r122  
    127127        chomp(); 
    128128        $item{title}  = &removetag($_); 
    129         $item{title} =~ s/【.*】//g;#【解】とか 
    130         $item{title} =~ s/\[.*\]//g;#[二]とか  
     129        $item{title} =~ s/【.*?】//g;#【解】とか 
     130        $item{title} =~ s/\[.*?\]//g;#[二]とか  
    131131        #print Dumper($_) ; 
    132132        #print "$result  \n"; 
     
    232232        #&writelog("xmltv2foltia DEBUG push(\@deleteepgid,$data[0]);"); 
    233233}#end while  
     234 
     235#上書きを消す 
     236$sth = $dbh->prepare($stmt{'xmltv2foltia.replaceepg.2'}); 
     237$sth->execute($foltiastarttime , $foltiaendtime , $ontvepgchannel); 
     238while (@data = $sth->fetchrow_array()) { 
     239        push(@deleteepgid,$data[0]); 
     240        #&writelog("xmltv2foltia DEBUG push(\@deleteepgid,$data[0]);"); 
     241}#end while  
     242 
    234243}#endsub replaceepg 
    235244 
     
    241250my $desc = $_[4]; 
    242251my $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!#$%&()*+,-./:;<=>?@[\]^_`{|}'); 
    243256 
    244257#&writelog("xmltv2foltia DEBUG $foltiastarttime:$foltiaendtime"); 
     
    288301        $sth = $dbh->prepare($stmt{'xmltv2foltia.commitdb.1'}); 
    289302        $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"); 
    291304} 
    292305#追加 
     
    294307        $sth = $dbh->prepare($stmt{'xmltv2foltia.commitdb.2'}); 
    295308        $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]"); 
    297310}# end for 
    298311$dbh->commit; 
track feed