Index: trunk/install/perl/foltialib.pl =================================================================== --- trunk/install/perl/foltialib.pl (リビジョン 111) +++ trunk/install/perl/foltialib.pl (リビジョン 124) @@ -399,5 +399,20 @@ - +sub mp4filename2tid{ +#MPEG4ファイル名からTIDを得る +my $mp4filename = $_[0]; + +my $sth; + $sth = $dbh->prepare($stmt{'foltialib.mp4filename2tid.1'}); + $sth->execute($mp4filename); +my @statusinfo = $sth->fetchrow_array; +my $tid = $statusinfo[0]; + +if ($tid eq ""){ + return 0 ; +}else{ + return $tid; +} +}#end sub mp4filename2tid Index: trunk/install/perl/db/Pg.pl =================================================================== --- trunk/install/perl/db/Pg.pl (リビジョン 122) +++ trunk/install/perl/db/Pg.pl (リビジョン 124) @@ -28,4 +28,5 @@ 'foltialib.getfilestatus.1' => "SELECT filestatus FROM foltia_subtitle WHERE pid = ?", 'foltialib.pid2sid.1' => "SELECT stationid FROM foltia_subtitle WHERE pid = ?", +'foltialib.mp4filename2tid.1' => "SELECT tid FROM foltia_subtitle WHERE PSPfilename = ?", 'getxml2db.1' => "SELECT count(*) FROM foltia_program WHERE tid = ?", Index: trunk/install/perl/deletemovie.pl =================================================================== --- trunk/install/perl/deletemovie.pl (リビジョン 97) +++ trunk/install/perl/deletemovie.pl (リビジョン 124) @@ -14,4 +14,7 @@ # # +use DBI; +use DBD::Pg; +use DBD::SQLite; $path = $0; @@ -32,5 +35,5 @@ #ファイル名正当性チェック -if ($fname =~ /.m2p$|.m2t$|.aac$/){ +if ($fname =~ /.m2p$|.m2t$|.MP4$|.aac$/){ }else{ @@ -40,8 +43,14 @@ } +#DB初期化 +$dbh = DBI->connect($DSN,$DBUser,$DBPass) ||die $DBI::error;; + #ファイル存在チェック - +my $tid = &mp4filename2tid($fname); +my $mp4dirname = &makemp4dir($tid); if (-e "$recfolderpath/$fname"){ - + $filemovepath = $recfolderpath; +}elsif(-e "$mp4dirname/$fname"){ + $filemovepath = $mp4dirname; }else{ # print "deletemovie file not found.$recfolderpath/$fname\n"; @@ -52,9 +61,9 @@ #既読削除処理 if ($rapidfiledelete > 0){ #./mita/へ移動 - system ("mv $recfolderpath/$fname $recfolderpath/mita/"); - &writelog("deletemovie mv $recfolderpath/$fname $recfolderpath/mita/."); + system ("mv $filemovepath/$fname $recfolderpath/mita/"); + &writelog("deletemovie mv filemovepath/$fname $recfolderpath/mita/."); }else{ #即時削除 - system ("rm $recfolderpath/$fname "); - &writelog("deletemovie rm $recfolderpath/$fname "); + system ("rm $filemovepath/$fname "); + &writelog("deletemovie rm $filemovepath/$fname ");