チェンジセット 124: trunk/install/perl
- コミット日時:
- 2010/10/13 21:01:58 (14 年前)
- ファイル:
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
trunk/install/perl/db/Pg.pl
r122 r124 28 28 'foltialib.getfilestatus.1' => "SELECT filestatus FROM foltia_subtitle WHERE pid = ?", 29 29 'foltialib.pid2sid.1' => "SELECT stationid FROM foltia_subtitle WHERE pid = ?", 30 'foltialib.mp4filename2tid.1' => "SELECT tid FROM foltia_subtitle WHERE PSPfilename = ?", 30 31 31 32 'getxml2db.1' => "SELECT count(*) FROM foltia_program WHERE tid = ?", trunk/install/perl/deletemovie.pl
r97 r124 14 14 # 15 15 # 16 use DBI; 17 use DBD::Pg; 18 use DBD::SQLite; 16 19 17 20 $path = $0; … … 32 35 33 36 #ファイル名正当性チェック 34 if ($fname =~ /.m2p$|.m2t$|. aac$/){37 if ($fname =~ /.m2p$|.m2t$|.MP4$|.aac$/){ 35 38 36 39 }else{ … … 40 43 } 41 44 45 #DB初期化 46 $dbh = DBI->connect($DSN,$DBUser,$DBPass) ||die $DBI::error;; 47 42 48 #ファイル存在チェック 43 49 my $tid = &mp4filename2tid($fname); 50 my $mp4dirname = &makemp4dir($tid); 44 51 if (-e "$recfolderpath/$fname"){ 45 52 $filemovepath = $recfolderpath; 53 }elsif(-e "$mp4dirname/$fname"){ 54 $filemovepath = $mp4dirname; 46 55 }else{ 47 56 # print "deletemovie file not found.$recfolderpath/$fname\n"; … … 52 61 #既読削除処理 53 62 if ($rapidfiledelete > 0){ #./mita/へ移動 54 system ("mv $ recfolderpath/$fname $recfolderpath/mita/");55 &writelog("deletemovie mv $recfolderpath/$fname $recfolderpath/mita/.");63 system ("mv $filemovepath/$fname $recfolderpath/mita/"); 64 &writelog("deletemovie mv filemovepath/$fname $recfolderpath/mita/."); 56 65 }else{ #即時削除 57 system ("rm $ recfolderpath/$fname ");58 &writelog("deletemovie rm $ recfolderpath/$fname ");66 system ("rm $filemovepath/$fname "); 67 &writelog("deletemovie rm $filemovepath/$fname "); 59 68 60 69 trunk/install/perl/foltialib.pl
r111 r124 399 399 400 400 401 401 sub mp4filename2tid{ 402 #MPEG4ファイル名からTIDを得る 403 my $mp4filename = $_[0]; 404 405 my $sth; 406 $sth = $dbh->prepare($stmt{'foltialib.mp4filename2tid.1'}); 407 $sth->execute($mp4filename); 408 my @statusinfo = $sth->fetchrow_array; 409 my $tid = $statusinfo[0]; 410 411 if ($tid eq ""){ 412 return 0 ; 413 }else{ 414 return $tid; 415 } 416 }#end sub mp4filename2tid 402 417 403 418