1 |
|
---|
2 |
|
---|
3 |
|
---|
4 |
|
---|
5 |
|
---|
6 |
|
---|
7 |
|
---|
8 |
|
---|
9 |
|
---|
10 |
|
---|
11 |
|
---|
12 |
|
---|
13 |
|
---|
14 |
|
---|
15 |
use Jcode; |
---|
16 |
use DBI; |
---|
17 |
use DBD::Pg; |
---|
18 |
|
---|
19 |
|
---|
20 |
$path = $0; |
---|
21 |
$path =~ s/mklocalizeddir.pl$//i; |
---|
22 |
if ($pwd ne "./"){ |
---|
23 |
push( @INC, "$path"); |
---|
24 |
} |
---|
25 |
require "foltialib.pl"; |
---|
26 |
|
---|
27 |
|
---|
28 |
$tid = $ARGV[0] ; |
---|
29 |
if ($tid eq "" ){ |
---|
30 |
|
---|
31 |
print "usage mklocalizeddir.pl [TID]\n"; |
---|
32 |
exit; |
---|
33 |
} |
---|
34 |
|
---|
35 |
|
---|
36 |
|
---|
37 |
if (-e "$recfolderpath/$tid.localized"){ |
---|
38 |
|
---|
39 |
}else{ |
---|
40 |
|
---|
41 |
|
---|
42 |
|
---|
43 |
|
---|
44 |
|
---|
45 |
my $data_source = sprintf("dbi:%s:dbname=%s;host=%s;port=%d", |
---|
46 |
$DBDriv,$DBName,$DBHost,$DBPort); |
---|
47 |
$dbh = DBI->connect($data_source,$DBUser,$DBPass) ||die $DBI::error;; |
---|
48 |
|
---|
49 |
|
---|
50 |
$DBQuery = "select title from foltia_program where tid=$tid "; |
---|
51 |
$sth = $dbh->prepare($DBQuery); |
---|
52 |
$sth->execute(); |
---|
53 |
@subticount= $sth->fetchrow_array; |
---|
54 |
$title = $subticount[0] ; |
---|
55 |
$titleeuc = $title ; |
---|
56 |
Jcode::convert(\$title , 'utf8', 'euc', "z"); |
---|
57 |
|
---|
58 |
|
---|
59 |
mkdir ("$recfolderpath/$tid.localized",0755); |
---|
60 |
mkdir ("$recfolderpath/$tid.localized/.localized",0755); |
---|
61 |
mkdir ("$recfolderpath/$tid.localized/mp4",0755); |
---|
62 |
mkdir ("$recfolderpath/$tid.localized/m2p",0755); |
---|
63 |
open (JASTRING,">$recfolderpath/$tid.localized/.localized/ja.strings") || die "Cannot write ja.strings.\n"; |
---|
64 |
print JASTRING "\"$tid\"=\"$title\";\n"; |
---|
65 |
close(JASTRING); |
---|
66 |
|
---|
67 |
&writelog("mklocalizeddir $tid $titleeuc"); |
---|
68 |
|
---|
69 |
} |
---|
70 |
|
---|