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 |
use DBD::SQLite; |
---|
19 |
|
---|
20 |
$path = $0; |
---|
21 |
$path =~ s/mklocalizeddir.pl$//i; |
---|
22 |
if ($path 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 |
$dbh = DBI->connect($DSN,$DBUser,$DBPass) ||die $DBI::error;; |
---|
46 |
|
---|
47 |
|
---|
48 |
$sth = $dbh->prepare($stmt{'mklocalizeddir.1'}); |
---|
49 |
$sth->execute($tid); |
---|
50 |
@subticount= $sth->fetchrow_array; |
---|
51 |
$title = $subticount[0] ; |
---|
52 |
$titleeuc = $title ; |
---|
53 |
Jcode::convert(\$title , 'utf8', 'euc', "z"); |
---|
54 |
|
---|
55 |
|
---|
56 |
mkdir ("$recfolderpath/$tid.localized",0755); |
---|
57 |
mkdir ("$recfolderpath/$tid.localized/.localized",0755); |
---|
58 |
mkdir ("$recfolderpath/$tid.localized/mp4",0755); |
---|
59 |
mkdir ("$recfolderpath/$tid.localized/m2p",0755); |
---|
60 |
open (JASTRING,">$recfolderpath/$tid.localized/.localized/ja.strings") || die "Cannot write ja.strings.\n"; |
---|
61 |
print JASTRING "\"$tid\"=\"$title\";\n"; |
---|
62 |
close(JASTRING); |
---|
63 |
|
---|
64 |
&writelog("mklocalizeddir $tid $titleeuc"); |
---|
65 |
|
---|
66 |
} |
---|
67 |
|
---|