Mercurial > epgrec.yaz
comparison recomplete.php @ 164:254d8a21bf36
fix: 予約済みの未実行録画にrecomplete.phpが必要なので戻した
author | Sushi-k <epgrec@park.mda.or.jp> |
---|---|
date | Tue, 06 Apr 2010 11:03:45 +0900 |
parents | |
children | 3d4df1fe4166 |
comparison
equal
deleted
inserted
replaced
163:b3095425e613 | 164:254d8a21bf36 |
---|---|
1 #!/usr/bin/php | |
2 <?php | |
3 $script_path = dirname( __FILE__ ); | |
4 chdir( $script_path ); | |
5 include_once( $script_path . '/config.php'); | |
6 include_once( INSTALL_PATH . "/DBRecord.class.php" ); | |
7 include_once( INSTALL_PATH . "/Settings.class.php" ); | |
8 include_once( INSTALL_PATH . "/recLog.inc.php" ); | |
9 | |
10 $settings = Settings::factory(); | |
11 | |
12 $reserve_id = $argv[1]; | |
13 | |
14 try{ | |
15 $rrec = new DBRecord( RESERVE_TBL, "id" , $reserve_id ); | |
16 $rrec->complete = '1'; | |
17 | |
18 if( file_exists( INSTALL_PATH .$settings->spool . "/". $rrec->path ) ) { | |
19 // 篋膣絎篋 | |
20 reclog( "recomplete:: 篋膣ID". $rrec->id .":".$rrec->type.$rrec->channel.$rrec->title."牙祉絎篋" ); | |
21 | |
22 if( $settings->mediatomb_update == 1 ) { | |
23 // <c緇c鴻腆阪c純 | |
24 @exec("sync"); | |
25 sleep(15); | |
26 $dbh = mysql_connect( $settings->db_host, $settings->db_user, $settings->db_pass ); | |
27 if( $dbh !== false ) { | |
28 $sqlstr = "use ".$settings->db_name; | |
29 @mysql_query( $sqlstr ); | |
30 // ャ | |
31 $sqlstr = "set NAME utf8"; | |
32 @mysql_query( $sqlstr ); | |
33 $sqlstr = "update mt_cds_object set metadata='dc:description=".mysql_real_escape_string($rrec->description)."&epgrec:id=".$reserve_id."' where dc_title='".$rrec->path."'"; | |
34 @mysql_query( $sqlstr ); | |
35 $sqlstr = "update mt_cds_object set dc_title='".mysql_real_escape_string($rrec->title)."(".date("Y/m/d").")' where dc_title='".$rrec->path."'"; | |
36 @mysql_query( $sqlstr ); | |
37 } | |
38 } | |
39 } | |
40 else { | |
41 // 篋膣紊掩 | |
42 reclog( "recomplete:: 篋膣ID". $rrec->id .":".$rrec->type.$rrec->channel.$rrec->title."牙祉紊掩罔≧", EPGREC_ERROR ); | |
43 $rrec->delete(); | |
44 } | |
45 } | |
46 catch( exception $e ) { | |
47 reclog( "recomplete:: 篋膣若≪祉鴻紊掩罔≧", EPGREC_ERROR ); | |
48 reclog( "recomplete:: ".$e->getMessage()."" , EPGREC_ERROR ); | |
49 exit( $e->getMessage() ); | |
50 } | |
51 | |
52 ?> |