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 "); Index: trunk/install/php/deletemovie.php =================================================================== --- trunk/install/php/deletemovie.php (リビジョン 97) +++ trunk/install/php/deletemovie.php (リビジョン 124) @@ -75,29 +75,58 @@
"; - - - foreach ($delete as $fName) { - $filesplit = split("-",$fName); - -/* -if ($filesplit[1] == ""){ +if( preg_match('/.MP4$/',$fName)){ //拡張子がMP4なら録画ライブラリ番組個別表示での削除 (showlibc.php) $query = " -SELECT -foltia_program.tid,foltia_program.title,foltia_subtitle.subtitle -FROM foltia_subtitle , foltia_program -WHERE foltia_program.tid = foltia_subtitle.tid - AND foltia_subtitle.tid = ? +SELECT +foltia_subtitle.pspfilename, +foltia_program.title, +foltia_subtitle.countno, +foltia_subtitle.subtitle +FROM foltia_subtitle,foltia_program +WHERE foltia_subtitle.tid = foltia_program.tid AND foltia_subtitle.pspfilename = ? +LIMIT 1"; + +$rs = sql_query($con, $query, "DBクエリに失敗しました",array($fName)); +$rall = $rs->fetch(); +$rowdata = $rall[0]; + +$title = htmlspecialchars($rall[1]); +$count = htmlspecialchars($rall[2]); +$subtitle = htmlspecialchars($rall[3]); + +print " +