Mercurial > epgrec.yaz
changeset 164:254d8a21bf36
fix: 予約済みの未実行録画にrecomplete.phpが必要なので戻した
author | Sushi-k <epgrec@park.mda.or.jp> |
---|---|
date | Tue, 06 Apr 2010 11:03:45 +0900 |
parents | b3095425e613 |
children | 3d4df1fe4166 68f6b36e7c01 |
files | recomplete.php |
diffstat | 1 files changed, 52 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/recomplete.php Tue Apr 06 11:03:45 2010 +0900 @@ -0,0 +1,52 @@ +#!/usr/bin/php +<?php +$script_path = dirname( __FILE__ ); +chdir( $script_path ); +include_once( $script_path . '/config.php'); +include_once( INSTALL_PATH . "/DBRecord.class.php" ); +include_once( INSTALL_PATH . "/Settings.class.php" ); +include_once( INSTALL_PATH . "/recLog.inc.php" ); + +$settings = Settings::factory(); + +$reserve_id = $argv[1]; + +try{ + $rrec = new DBRecord( RESERVE_TBL, "id" , $reserve_id ); + $rrec->complete = '1'; + + if( file_exists( INSTALL_PATH .$settings->spool . "/". $rrec->path ) ) { + // 篋膣絎篋 + reclog( "recomplete:: 篋膣ID". $rrec->id .":".$rrec->type.$rrec->channel.$rrec->title."牙祉絎篋" ); + + if( $settings->mediatomb_update == 1 ) { + // <c緇c鴻腆阪c純 + @exec("sync"); + sleep(15); + $dbh = mysql_connect( $settings->db_host, $settings->db_user, $settings->db_pass ); + if( $dbh !== false ) { + $sqlstr = "use ".$settings->db_name; + @mysql_query( $sqlstr ); + // ャ + $sqlstr = "set NAME utf8"; + @mysql_query( $sqlstr ); + $sqlstr = "update mt_cds_object set metadata='dc:description=".mysql_real_escape_string($rrec->description)."&epgrec:id=".$reserve_id."' where dc_title='".$rrec->path."'"; + @mysql_query( $sqlstr ); + $sqlstr = "update mt_cds_object set dc_title='".mysql_real_escape_string($rrec->title)."(".date("Y/m/d").")' where dc_title='".$rrec->path."'"; + @mysql_query( $sqlstr ); + } + } + } + else { + // 篋膣紊掩 + reclog( "recomplete:: 篋膣ID". $rrec->id .":".$rrec->type.$rrec->channel.$rrec->title."牙祉紊掩罔≧", EPGREC_ERROR ); + $rrec->delete(); + } +} +catch( exception $e ) { + reclog( "recomplete:: 篋膣若≪祉鴻紊掩罔≧", EPGREC_ERROR ); + reclog( "recomplete:: ".$e->getMessage()."" , EPGREC_ERROR ); + exit( $e->getMessage() ); +} + +?>