Index: trunk/install/perl/db/Pg.pl =================================================================== --- trunk/install/perl/db/Pg.pl (リビジョン 121) +++ trunk/install/perl/db/Pg.pl (リビジョン 122) @@ -74,4 +74,5 @@ 'xmltv2foltia.replaceepg.1' => "SELECT * FROM foltia_epg WHERE enddatetime > ? AND startdatetime < ? AND ontvchannel = ? AND startdatetime > ?", +'xmltv2foltia.replaceepg.2' => "SELECT * FROM foltia_epg WHERE startdatetime = ? AND enddatetime = ? AND ontvchannel = ? ", 'xmltv2foltia.commitdb.1' => "DELETE FROM foltia_epg WHERE epgid = ?", 'xmltv2foltia.commitdb.2' => "INSERT INTO foltia_epg VALUES ( nextval('foltia_epg_epgid_seq'), ?, ?, ?, ?, ?, ?, ?)" , Index: trunk/install/perl/xmltv2foltia.pl =================================================================== --- trunk/install/perl/xmltv2foltia.pl (リビジョン 121) +++ trunk/install/perl/xmltv2foltia.pl (リビジョン 122) @@ -127,6 +127,6 @@ chomp(); $item{title} = &removetag($_); - $item{title} =~ s/【.*】//g;#【解】とか - $item{title} =~ s/\[.*\]//g;#[二]とか + $item{title} =~ s/【.*?】//g;#【解】とか + $item{title} =~ s/\[.*?\]//g;#[二]とか #print Dumper($_) ; #print "$result \n"; @@ -232,4 +232,13 @@ #&writelog("xmltv2foltia DEBUG push(\@deleteepgid,$data[0]);"); }#end while + +#上書きを消す +$sth = $dbh->prepare($stmt{'xmltv2foltia.replaceepg.2'}); +$sth->execute($foltiastarttime , $foltiaendtime , $ontvepgchannel); +while (@data = $sth->fetchrow_array()) { + push(@deleteepgid,$data[0]); + #&writelog("xmltv2foltia DEBUG push(\@deleteepgid,$data[0]);"); +}#end while + }#endsub replaceepg @@ -241,4 +250,8 @@ my $desc = $_[4]; my $category = $_[5]; + +#Encode::JP::H2Z::z2h(\$string); +$title = jcode($title)->tr('A-Za-z0-9!#$%&()*+,−./:;<=>?@[\]^_`{|}','A-Za-z0-9!#$%&()*+,-./:;<=>?@[\]^_`{|}'); +$desc = jcode($desc)->tr('A-Za-z0-9!#$%&()*+,−./:;<=>?@[\]^_`{|}','A-Za-z0-9!#$%&()*+,-./:;<=>?@[\]^_`{|}'); #&writelog("xmltv2foltia DEBUG $foltiastarttime:$foltiaendtime"); @@ -288,5 +301,5 @@ $sth = $dbh->prepare($stmt{'xmltv2foltia.commitdb.1'}); $sth->execute( $delid ) || warn "$delid\n"; -# &writelog("xmltv2foltia DEBUG : DELETE FROM foltia_epg WHERE epgid = $delid"); + #&writelog("xmltv2foltia DEBUG $stmt{'xmltv2foltia.commitdb.1'}/$delid"); } #追加 @@ -294,5 +307,5 @@ $sth = $dbh->prepare($stmt{'xmltv2foltia.commitdb.2'}); $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"; -#&writelog("xmltv2foltia DEBUG : INSERT INTO foltia_epg VALUES ( NULL , $foltiastarttime[$i],$foltiaendtime[$i], $lengthmin[$i], $channel[$i], $title[$i], $desc[$i], $category[$i])"); + #&writelog("xmltv2foltia DEBUG $stmt{'xmltv2foltia.commitdb.2'}/$foltiastarttime[$i],$foltiaendtime[$i], $lengthmin[$i], $channel[$i], $title[$i], $desc[$i], $category[$i]"); }# end for $dbh->commit;