Mercurial > epgrec.yaz
annotate recomplete.php @ 14:bbbc4f1ecf1d
added: remove video with real file.
author | Sushi-k <epgrec@park.mda.or.jp> |
---|---|
date | Tue, 14 Jul 2009 20:11:42 +0900 |
parents | b0fc647167f5 |
children | cf19005e65d1 |
rev | line source |
---|---|
1 | 1 #!/usr/bin/php |
2 <?php | |
3 include_once( "config.php" ); | |
4 include_once( INSTALL_PATH . "/DBRecord.class.php" ); | |
5 | |
6 $reserve_id = $argv[1]; | |
7 | |
8 try{ | |
9 $rrec = new DBRecord( TBL_PREFIX.RESERVE_TBL, "id" , $reserve_id ); | |
10 | |
11 if( file_exists( INSTALL_PATH . SPOOL . "/". $rrec->path ) ) { | |
12 // 予約完了 | |
13 $rrec->complete = '1'; | |
11
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
14 if( MEDIATOMB_UPDATE) { |
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
15 $dbh = mysql_connect( DB_HOST, DB_USER, DB_PASS ); |
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
16 if( $dbh !== false ) { |
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
17 $sqlstr = "use ".DB_NAME; |
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
18 mysql_query( $sqlstr ); |
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
19 // 別にやらなくてもいいが |
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
20 $sqlstr = "set NAME utf8"; |
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
21 mysql_query( $sqlstr ); |
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
22 $sqlstr = "update mt_cds_object set metadata='dc:description=".$rrec->description."' where dc_title='".$rrec->path."'"; |
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
23 mysql_query( $sqlstr ); |
13
b0fc647167f5
modified: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
11
diff
changeset
|
24 $sqlstr = "update mt_cds_object set dc_title='".$rrec->title."(".date("Y/m/d").")' where dc_title='".$rrec->path."'"; |
11
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
25 mysql_query( $sqlstr ); |
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
26 } |
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
27 } |
1 | 28 } |
29 else { | |
30 // 予約失敗 | |
31 $rrec->delete(); | |
32 } | |
33 } | |
34 catch( exception $e ) { | |
35 exit( $e->getMessage() ); | |
36 } | |
37 | |
38 ?> |