diff recomplete.php @ 11:065d48346fff

support mediatomb db update (testing)
author yoneda <yoneda@debian.localnet.mda.or.jp>
date Mon, 13 Jul 2009 23:46:20 +0900
parents f5a9f0eb4858
children b0fc647167f5
line wrap: on
line diff
--- a/recomplete.php	Mon Jul 13 17:12:07 2009 +0900
+++ b/recomplete.php	Mon Jul 13 23:46:20 2009 +0900
@@ -11,6 +11,20 @@
 	if( file_exists( INSTALL_PATH . SPOOL . "/". $rrec->path ) ) {
 		// 予約完了
 		$rrec->complete = '1';
+		if( MEDIATOMB_UPDATE) {
+			$dbh = mysql_connect( DB_HOST, DB_USER, DB_PASS );
+			if( $dbh !== false ) {
+				$sqlstr = "use ".DB_NAME;
+				mysql_query( $sqlstr );
+				// 別にやらなくてもいいが
+				$sqlstr = "set NAME utf8";
+				mysql_query( $sqlstr );
+				$sqlstr = "update mt_cds_object set metadata='dc:description=".$rrec->description."' where dc_title='".$rrec->path."'";
+				mysql_query( $sqlstr );
+				$sqlstr = "update mt_cds_object set dc_title='".$rrec->title."' where dc_title='".$rrec->path."'";
+				mysql_query( $sqlstr );
+			}
+		}	
 	}
 	else {
 		// 予約失敗