line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package IMDB::Local::Title; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
3122
|
use 5.006; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
24
|
|
5
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
IMDB::Local::Title - Object representation of Title information. |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Version 0.01 |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=cut |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
our $VERSION = '1.00'; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 SYNOPSIS |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
Quick summary of what the module does. |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
Perhaps a little code snippet. |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
use IMDB::Local::Title; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $foo = IMDB::Local::Title->new(); |
28
|
|
|
|
|
|
|
... |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 EXPORT |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
A list of functions that can be exported. You can delete this section |
33
|
|
|
|
|
|
|
if you don't export anything, such as for a purely object-oriented module. |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 SUBROUTINES/METHODS |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head2 function1 |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=cut |
40
|
|
|
|
|
|
|
|
41
|
1
|
|
|
1
|
|
4
|
use IMDB::Local::DB::BaseObject; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
6
|
|
42
|
1
|
|
|
1
|
|
22
|
use base qw(IMDB::Local::DB::BaseObject); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
96
|
|
43
|
|
|
|
|
|
|
|
44
|
1
|
|
|
1
|
|
5
|
use constant DB_TABLE => 'Titles'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
52
|
|
45
|
1
|
|
|
1
|
|
4
|
use constant DB_KEY => 'TitleID'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
77
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
use Class::MethodMaker |
48
|
|
|
|
|
|
|
[ |
49
|
1
|
|
|
|
|
15
|
scalar => [DB_KEY], |
50
|
|
|
|
|
|
|
array => [qw/ -static db_columns/], |
51
|
|
|
|
|
|
|
scalar => ['QualifierType'], |
52
|
|
|
|
|
|
|
array => ['Directors'], |
53
|
|
|
|
|
|
|
array => ['Actors'], |
54
|
|
|
|
|
|
|
array => ['Hosts'], |
55
|
|
|
|
|
|
|
array => ['Narrators'], |
56
|
|
|
|
|
|
|
array => ['Genres'], |
57
|
|
|
|
|
|
|
array => ['Keywords'], |
58
|
|
|
|
|
|
|
array => ['Plots'], |
59
|
|
|
|
|
|
|
scalar => ['Rating'], |
60
|
|
|
|
|
|
|
new => [qw/ -init -hash new/] , |
61
|
1
|
|
|
1
|
|
4
|
]; |
|
1
|
|
|
|
|
1
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub init($) |
64
|
|
|
|
|
|
|
{ |
65
|
0
|
|
|
0
|
0
|
|
my ($self)=@_; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
# static array needs to be initialized only if it isn't already |
68
|
|
|
|
|
|
|
#if ( !$self->db_ignoredColumns_count ) { |
69
|
|
|
|
|
|
|
#$self->db_ignoredColumns_push(DB_COLUMNS_IGNORE); |
70
|
|
|
|
|
|
|
#} |
71
|
|
|
|
|
|
|
|
72
|
0
|
|
|
|
|
|
$self->initHandle(DB_TABLE, DB_KEY); |
73
|
|
|
|
|
|
|
|
74
|
0
|
0
|
|
|
|
|
if ( $self->populateUsingKey($self->get(DB_KEY)) ) { |
75
|
0
|
|
|
|
|
|
return $self; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
0
|
|
|
|
|
|
return(undef); |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
1
|
|
|
1
|
|
4988
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
426
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub createNew($%) |
84
|
|
|
|
|
|
|
{ |
85
|
0
|
|
|
0
|
0
|
|
my ($imdbdb, %args)=@_; |
86
|
|
|
|
|
|
|
|
87
|
0
|
0
|
|
|
|
|
carp("no name given") if ( !defined($args{name}) ); |
88
|
|
|
|
|
|
|
|
89
|
0
|
|
|
|
|
|
my $id=$imdbdb->insert_db(DB_TABLE, DB_KEY, %args); |
90
|
0
|
0
|
|
|
|
|
if ( !defined($id) ) { |
91
|
0
|
|
|
|
|
|
return(undef); |
92
|
|
|
|
|
|
|
} |
93
|
0
|
|
|
|
|
|
return new IMDB::Local::Title(imdbdb=>$imdbdb, TableID=>$id); |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
sub findByTitleID($$) |
97
|
|
|
|
|
|
|
{ |
98
|
0
|
|
|
0
|
0
|
|
my ($imdbdb, $id)=@_; |
99
|
0
|
|
|
|
|
|
return new IMDB::Local::Title(imdbdb=>$imdbdb, DB_KEY, $id); |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
sub findByName($$) |
103
|
|
|
|
|
|
|
{ |
104
|
0
|
|
|
0
|
0
|
|
my ($imdbdb, $name)=@_; |
105
|
|
|
|
|
|
|
|
106
|
0
|
|
|
|
|
|
my $id=$imdbdb->select2Scalar("SELECT ".DB_KEY." from ".DB_TABLE." where name='$name'"); |
107
|
0
|
0
|
|
|
|
|
if ( defined($id) ) { |
108
|
0
|
|
|
|
|
|
return new IMDB::Local::Title(imdbdb=>$imdbdb, DB_KEY, $id); |
109
|
|
|
|
|
|
|
} |
110
|
0
|
|
|
|
|
|
return(undef); |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
sub findBySearchableTitle($$$) |
114
|
|
|
|
|
|
|
{ |
115
|
0
|
|
|
0
|
0
|
|
my ($imdbdb, $name, $qualifierTypeID)=@_; |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
#warn "SELECT ".DB_KEY." from ".DB_TABLE." where SearchTitle='$name'"; |
118
|
0
|
|
|
|
|
|
my $sql="SELECT ".DB_KEY." from ".DB_TABLE." where SearchTitle='$name'"; |
119
|
0
|
0
|
|
|
|
|
if ( $qualifierTypeID ) { |
120
|
0
|
|
|
|
|
|
$sql.=" AND QualifierTypeID=$qualifierTypeID"; |
121
|
|
|
|
|
|
|
} |
122
|
0
|
|
|
|
|
|
my @id=@{$imdbdb->select2Array($sql)}; |
|
0
|
|
|
|
|
|
|
123
|
0
|
0
|
0
|
|
|
|
if ( @id && !defined($id[0]) ) { |
124
|
0
|
|
|
|
|
|
return(undef); |
125
|
|
|
|
|
|
|
} |
126
|
|
|
|
|
|
|
#warn("found: ".scalar(@id)."\n"); |
127
|
0
|
|
|
|
|
|
return(@id); |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
|
130
|
1
|
|
|
1
|
|
6
|
use IMDB::Local::QualifierType; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
7
|
|
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
sub hasParentTitle($) |
133
|
|
|
|
|
|
|
{ |
134
|
0
|
|
|
0
|
0
|
|
my ($self)=@_; |
135
|
0
|
|
|
|
|
|
return($self->ParentID != 0 ); |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
sub getParentTitle($) |
139
|
|
|
|
|
|
|
{ |
140
|
0
|
|
|
0
|
0
|
|
my ($self)=@_; |
141
|
|
|
|
|
|
|
|
142
|
0
|
0
|
|
|
|
|
if ( $self->hasParentTitle ) { |
143
|
0
|
|
|
|
|
|
return new IMDB::Local::Title(imdbdb=>$self->imdbdb, TitleID=>$self->ParentID); |
144
|
|
|
|
|
|
|
} |
145
|
0
|
|
|
|
|
|
return(undef); |
146
|
|
|
|
|
|
|
} |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
sub populateQualifierType($) |
149
|
|
|
|
|
|
|
{ |
150
|
0
|
|
|
0
|
0
|
|
my ($self)=@_; |
151
|
|
|
|
|
|
|
|
152
|
0
|
|
|
|
|
|
$self->QualifierType(new IMDB::Local::QualifierType(imdbdb=>$self->imdbdb, QualifierTypeID=>$self->QualifierTypeID)); |
153
|
0
|
|
|
|
|
|
return $self->QualifierType; |
154
|
|
|
|
|
|
|
} |
155
|
|
|
|
|
|
|
|
156
|
1
|
|
|
1
|
|
534
|
use IMDB::Local::Plot; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
15
|
|
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
sub populatePlots($) |
159
|
|
|
|
|
|
|
{ |
160
|
0
|
|
|
0
|
0
|
|
my ($self)=@_; |
161
|
|
|
|
|
|
|
|
162
|
0
|
|
|
|
|
|
for my $id (@{$self->imdbdb->select2Array("SELECT PlotID from Plots where TitleID=".$self->TitleID." order by Sequence")}) { |
|
0
|
|
|
|
|
|
|
163
|
0
|
|
|
|
|
|
my $r=new IMDB::Local::Plot(imdbdb=>$self->imdbdb, PlotID=>$id); |
164
|
0
|
0
|
|
|
|
|
if ( $r ) { |
165
|
0
|
|
|
|
|
|
$self->Plots_push($r) |
166
|
|
|
|
|
|
|
} |
167
|
|
|
|
|
|
|
} |
168
|
|
|
|
|
|
|
} |
169
|
|
|
|
|
|
|
|
170
|
1
|
|
|
1
|
|
443
|
use IMDB::Local::Rating; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
11
|
|
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
sub populateRating($) |
173
|
|
|
|
|
|
|
{ |
174
|
0
|
|
|
0
|
0
|
|
my ($self)=@_; |
175
|
|
|
|
|
|
|
|
176
|
0
|
0
|
|
|
|
|
if ( $self->imdbdb->rowExists('Ratings', 'TitleID', $self->TitleID) ) { |
177
|
0
|
|
|
|
|
|
$self->Rating(new IMDB::Local::Rating(imdbdb=>$self->imdbdb, TitleID=>$self->TitleID)); |
178
|
|
|
|
|
|
|
} |
179
|
0
|
|
|
|
|
|
return $self->Rating; |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
} |
182
|
|
|
|
|
|
|
|
183
|
1
|
|
|
1
|
|
399
|
use IMDB::Local::Director; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
9
|
|
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
sub populateDirectors($) |
186
|
|
|
|
|
|
|
{ |
187
|
0
|
|
|
0
|
0
|
|
my ($self)=@_; |
188
|
|
|
|
|
|
|
|
189
|
0
|
|
|
|
|
|
for my $id (@{$self->imdbdb->select2Array("SELECT DirectorID from Titles2Directors where TitleID=".$self->TitleID)}) { |
|
0
|
|
|
|
|
|
|
190
|
0
|
|
|
|
|
|
my $dir=new IMDB::Local::Director(imdbdb=>$self->imdbdb, DirectorID=>$id); |
191
|
0
|
0
|
|
|
|
|
if ( $dir ) { |
192
|
0
|
|
|
|
|
|
$self->Directors_push($dir) |
193
|
|
|
|
|
|
|
} |
194
|
|
|
|
|
|
|
} |
195
|
|
|
|
|
|
|
} |
196
|
|
|
|
|
|
|
|
197
|
1
|
|
|
1
|
|
366
|
use IMDB::Local::Actor; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
sub populateActors($) |
200
|
|
|
|
|
|
|
{ |
201
|
0
|
|
|
0
|
0
|
|
my ($self)=@_; |
202
|
|
|
|
|
|
|
|
203
|
0
|
|
|
|
|
|
for my $id (@{$self->imdbdb->select2Array("SELECT ActorID from Titles2Actors where TitleID=".$self->TitleID." order by Billing")}) { |
|
0
|
|
|
|
|
|
|
204
|
0
|
|
|
|
|
|
my $r=new IMDB::Local::Actor(imdbdb=>$self->imdbdb, ActorID=>$id); |
205
|
0
|
0
|
|
|
|
|
if ( $r ) { |
206
|
0
|
|
|
|
|
|
$self->Actors_push($r) |
207
|
|
|
|
|
|
|
} |
208
|
|
|
|
|
|
|
} |
209
|
|
|
|
|
|
|
} |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
sub populateHosts($) |
212
|
|
|
|
|
|
|
{ |
213
|
0
|
|
|
0
|
0
|
|
my ($self)=@_; |
214
|
|
|
|
|
|
|
|
215
|
0
|
|
|
|
|
|
for my $id (@{$self->imdbdb->select2Array("SELECT ActorID from Titles2Hosts where TitleID=".$self->TitleID)}) { |
|
0
|
|
|
|
|
|
|
216
|
0
|
|
|
|
|
|
my $r=new IMDB::Local::Actor(imdbdb=>$self->imdbdb, ActorID=>$id); |
217
|
0
|
0
|
|
|
|
|
if ( $r ) { |
218
|
0
|
|
|
|
|
|
$self->Hosts_push($r) |
219
|
|
|
|
|
|
|
} |
220
|
|
|
|
|
|
|
} |
221
|
|
|
|
|
|
|
} |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
sub populateNarrators($) |
224
|
|
|
|
|
|
|
{ |
225
|
0
|
|
|
0
|
0
|
|
my ($self)=@_; |
226
|
|
|
|
|
|
|
|
227
|
0
|
|
|
|
|
|
for my $id (@{$self->imdbdb->select2Array("SELECT ActorID from Titles2Narrators where TitleID=".$self->TitleID)}) { |
|
0
|
|
|
|
|
|
|
228
|
0
|
|
|
|
|
|
my $r=new IMDB::Local::Actor(imdbdb=>$self->imdbdb, ActorID=>$id); |
229
|
0
|
0
|
|
|
|
|
if ( $r ) { |
230
|
0
|
|
|
|
|
|
$self->Narrators_push($r) |
231
|
|
|
|
|
|
|
} |
232
|
|
|
|
|
|
|
} |
233
|
|
|
|
|
|
|
} |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
sub _sortEpisodes |
236
|
|
|
|
|
|
|
{ |
237
|
0
|
|
|
0
|
|
|
my ($a, $b)=@_; |
238
|
|
|
|
|
|
|
|
239
|
0
|
0
|
|
|
|
|
if ( $a->Series == $b->Series ) { |
240
|
0
|
|
|
|
|
|
return($a->Episode <=> $b->Episode); |
241
|
|
|
|
|
|
|
} |
242
|
0
|
|
|
|
|
|
return($a->Series <=> $b->Series); |
243
|
|
|
|
|
|
|
} |
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
sub getEpisodes($) |
246
|
|
|
|
|
|
|
{ |
247
|
0
|
|
|
0
|
0
|
|
my ($self)=@_; |
248
|
|
|
|
|
|
|
|
249
|
0
|
0
|
|
|
|
|
if ( $self->QualifierType->Name ne 'tv_series' ) { |
250
|
0
|
|
|
|
|
|
carp("not an episodal title"); |
251
|
|
|
|
|
|
|
} |
252
|
|
|
|
|
|
|
|
253
|
0
|
|
|
|
|
|
my @episodes; |
254
|
|
|
|
|
|
|
|
255
|
0
|
|
|
|
|
|
for my $id (@{$self->imdbdb->select2Array("SELECT TitleID from Titles where ParentID=".$self->TitleID." order by Series,Episode")}) { |
|
0
|
|
|
|
|
|
|
256
|
0
|
|
|
|
|
|
my $e=IMDB::Local::Title::findByTitleID($self->imdbdb, $id); |
257
|
0
|
0
|
|
|
|
|
if ( $e ) { |
258
|
0
|
|
|
|
|
|
push(@episodes, $e); |
259
|
|
|
|
|
|
|
} |
260
|
|
|
|
|
|
|
} |
261
|
0
|
|
|
|
|
|
return(sort {_sortEpisodes($a,$b)} @episodes); |
|
0
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
} |
263
|
|
|
|
|
|
|
|
264
|
1
|
|
|
1
|
|
638
|
use IMDB::Local::Genre; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
sub populateGenres($) |
267
|
|
|
|
|
|
|
{ |
268
|
0
|
|
|
0
|
0
|
|
my ($self)=@_; |
269
|
|
|
|
|
|
|
|
270
|
0
|
|
|
|
|
|
for my $id (@{$self->imdbdb->select2Array("SELECT GenreID from Titles2Genres where TitleID=".$self->TitleID." order by GenreID")}) { |
|
0
|
|
|
|
|
|
|
271
|
0
|
|
|
|
|
|
my $r=new IMDB::Local::Genre(imdbdb=>$self->imdbdb, GenreID=>$id); |
272
|
0
|
0
|
|
|
|
|
if ( $r ) { |
273
|
0
|
|
|
|
|
|
$self->Genres_push($r) |
274
|
|
|
|
|
|
|
} |
275
|
|
|
|
|
|
|
} |
276
|
|
|
|
|
|
|
} |
277
|
|
|
|
|
|
|
|
278
|
1
|
|
|
1
|
|
450
|
use IMDB::Local::Keyword; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
279
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
sub populateKeywords($) |
281
|
|
|
|
|
|
|
{ |
282
|
0
|
|
|
0
|
0
|
|
my ($self)=@_; |
283
|
|
|
|
|
|
|
|
284
|
0
|
|
|
|
|
|
for my $id (@{$self->imdbdb->select2Array("SELECT KeywordID from Titles2Keywords where TitleID=".$self->TitleID)}) { |
|
0
|
|
|
|
|
|
|
285
|
0
|
|
|
|
|
|
my $r=new IMDB::Local::Keyword(imdbdb=>$self->imdbdb, KeywordID=>$id); |
286
|
0
|
0
|
|
|
|
|
if ( $r ) { |
287
|
0
|
|
|
|
|
|
$self->Keywords_push($r) |
288
|
|
|
|
|
|
|
} |
289
|
|
|
|
|
|
|
} |
290
|
|
|
|
|
|
|
} |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
sub populateAll($) |
293
|
|
|
|
|
|
|
{ |
294
|
0
|
|
|
0
|
0
|
|
my ($self)=@_; |
295
|
|
|
|
|
|
|
|
296
|
0
|
|
|
|
|
|
$self->populateQualifierType(); |
297
|
|
|
|
|
|
|
|
298
|
0
|
|
|
|
|
|
$self->populatePlots(); |
299
|
0
|
|
|
|
|
|
$self->populateDirectors(); |
300
|
0
|
|
|
|
|
|
$self->populateActors(); |
301
|
0
|
|
|
|
|
|
$self->populateHosts(); |
302
|
0
|
|
|
|
|
|
$self->populateNarrators(); |
303
|
0
|
|
|
|
|
|
$self->populateGenres(); |
304
|
0
|
|
|
|
|
|
$self->populateKeywords(); |
305
|
0
|
|
|
|
|
|
$self->populateRating(); |
306
|
|
|
|
|
|
|
} |
307
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
sub toText($) |
309
|
|
|
|
|
|
|
{ |
310
|
0
|
|
|
0
|
0
|
|
my ($self)=@_; |
311
|
0
|
|
|
|
|
|
my $text=''; |
312
|
|
|
|
|
|
|
|
313
|
0
|
|
|
|
|
|
$text.=$self->SUPER::toText(); |
314
|
|
|
|
|
|
|
|
315
|
0
|
|
|
|
|
|
$text.="URL:".$self->imdbUrl()."\n"; |
316
|
|
|
|
|
|
|
|
317
|
0
|
0
|
|
|
|
|
if ( $self->QualifierType ) { |
318
|
0
|
|
|
|
|
|
$text.=$self->QualifierType->toText(); |
319
|
|
|
|
|
|
|
} |
320
|
|
|
|
|
|
|
|
321
|
0
|
0
|
0
|
|
|
|
if ( $self->Directors && $self->Directors_count ) { |
322
|
0
|
|
|
|
|
|
for (my $n=0; $n < $self->Directors_count() ; $n++) { |
323
|
0
|
|
|
|
|
|
$text.="Director #$n:\n"; |
324
|
0
|
|
|
|
|
|
for my $line (split(/\n/, $self->Directors_index($n)->toText())) { |
325
|
0
|
|
|
|
|
|
$text.="\t$line\n"; |
326
|
|
|
|
|
|
|
} |
327
|
|
|
|
|
|
|
} |
328
|
|
|
|
|
|
|
} |
329
|
|
|
|
|
|
|
|
330
|
0
|
0
|
0
|
|
|
|
if ( $self->Actors && $self->Actors_count ) { |
331
|
0
|
|
|
|
|
|
$text.="Actors:\n"; |
332
|
0
|
|
|
|
|
|
for (my $n=0; $n < $self->Actors_count() ; $n++) { |
333
|
0
|
|
|
|
|
|
$text.="\t".$self->Actors_index($n)->Name()."\n"; |
334
|
|
|
|
|
|
|
} |
335
|
|
|
|
|
|
|
} |
336
|
0
|
0
|
0
|
|
|
|
if ( $self->Hosts && $self->Hosts_count ) { |
337
|
0
|
|
|
|
|
|
$text.="Hosts:\n"; |
338
|
0
|
|
|
|
|
|
for (my $n=0; $n < $self->Hosts_count() ; $n++) { |
339
|
0
|
|
|
|
|
|
$text.="\t".$self->Hosts_index($n)->Name()."\n"; |
340
|
|
|
|
|
|
|
} |
341
|
|
|
|
|
|
|
} |
342
|
0
|
0
|
0
|
|
|
|
if ( $self->Narrators && $self->Narrators_count ) { |
343
|
0
|
|
|
|
|
|
$text.="Narrators:\n"; |
344
|
0
|
|
|
|
|
|
for (my $n=0; $n < $self->Narrators_count() ; $n++) { |
345
|
0
|
|
|
|
|
|
$text.="\t".$self->Narrators_index($n)->Name()."\n"; |
346
|
|
|
|
|
|
|
} |
347
|
|
|
|
|
|
|
} |
348
|
0
|
0
|
0
|
|
|
|
if ( $self->Genres && $self->Genres_count ) { |
349
|
0
|
|
|
|
|
|
$text.="Genres:"; |
350
|
0
|
|
|
|
|
|
for (my $n=0; $n < $self->Genres_count() ; $n++) { |
351
|
0
|
|
|
|
|
|
$text.="".$self->Genres_index($n)->Name.","; |
352
|
|
|
|
|
|
|
} |
353
|
0
|
|
|
|
|
|
$text=~s/,$/\n/o; |
354
|
|
|
|
|
|
|
} |
355
|
|
|
|
|
|
|
|
356
|
0
|
0
|
0
|
|
|
|
if ( $self->Keywords && $self->Keywords_count ) { |
357
|
0
|
|
|
|
|
|
$text.="Keywords:"; |
358
|
0
|
|
|
|
|
|
for (my $n=0; $n < $self->Keywords_count() ; $n++) { |
359
|
0
|
|
|
|
|
|
$text.="".$self->Keywords_index($n)->Name.","; |
360
|
|
|
|
|
|
|
} |
361
|
0
|
|
|
|
|
|
$text=~s/,$/\n/o; |
362
|
|
|
|
|
|
|
} |
363
|
|
|
|
|
|
|
|
364
|
0
|
0
|
|
|
|
|
if ( $self->Rating ) { |
365
|
0
|
|
|
|
|
|
$text.="Rating:Rank=".$self->Rating()->Rank.", Dist=".$self->Rating()->Distribution.", Votes=".$self->Rating()->Votes."\n"; |
366
|
|
|
|
|
|
|
} |
367
|
|
|
|
|
|
|
|
368
|
0
|
0
|
0
|
|
|
|
if ( $self->Plots && $self->Plots_count ) { |
369
|
0
|
|
|
|
|
|
for (my $n=0; $n < $self->Plots_count() ; $n++) { |
370
|
0
|
|
|
|
|
|
my $p=$self->Plots_index($n); |
371
|
0
|
|
|
|
|
|
$text.="Plot #:".$p->Sequence; |
372
|
0
|
|
|
|
|
|
for my $line (split(/\n/, $p->toText())) { |
373
|
0
|
|
|
|
|
|
$text.="\t$line\n"; |
374
|
|
|
|
|
|
|
} |
375
|
|
|
|
|
|
|
} |
376
|
|
|
|
|
|
|
} |
377
|
0
|
|
|
|
|
|
return($text); |
378
|
|
|
|
|
|
|
} |
379
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
sub imdbUrl |
381
|
|
|
|
|
|
|
{ |
382
|
0
|
|
|
0
|
0
|
|
my ($self)=@_; |
383
|
|
|
|
|
|
|
|
384
|
0
|
0
|
|
|
|
|
if ( !defined($self->QualifierType) ) { |
385
|
0
|
|
|
|
|
|
$self->populateQualifierType(); |
386
|
|
|
|
|
|
|
} |
387
|
|
|
|
|
|
|
|
388
|
0
|
|
|
|
|
|
my $dbkey; |
389
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
# tv_series |
391
|
0
|
0
|
|
|
|
|
if ( $self->QualifierType->QualifierTypeID == 3 ) { |
|
|
0
|
|
|
|
|
|
392
|
0
|
|
|
|
|
|
$dbkey='"'.$self->Title.'"'; |
393
|
|
|
|
|
|
|
} |
394
|
|
|
|
|
|
|
# episode_of_tv_series |
395
|
|
|
|
|
|
|
elsif ( $self->QualifierType->QualifierTypeID == 13 ) { |
396
|
|
|
|
|
|
|
# need to retrieve title from parent |
397
|
0
|
|
|
|
|
|
my $t=$self->getParentTitle(); |
398
|
0
|
0
|
|
|
|
|
if ( $t ) { |
399
|
0
|
|
|
|
|
|
$dbkey='"'.$t->Title.'"'; |
400
|
|
|
|
|
|
|
} |
401
|
|
|
|
|
|
|
} |
402
|
|
|
|
|
|
|
else { |
403
|
0
|
|
|
|
|
|
$dbkey=$self->Title; |
404
|
|
|
|
|
|
|
} |
405
|
|
|
|
|
|
|
|
406
|
0
|
0
|
|
|
|
|
if ( $self->Year != 0 ) { |
407
|
0
|
|
|
|
|
|
$dbkey.=" (".$self->Year.")"; |
408
|
|
|
|
|
|
|
} |
409
|
|
|
|
|
|
|
|
410
|
0
|
|
|
|
|
|
$dbkey=~s/([^a-zA-Z0-9_.-])/uc sprintf("%%%02x",ord($1))/oeg; |
|
0
|
|
|
|
|
|
|
411
|
|
|
|
|
|
|
|
412
|
0
|
|
|
|
|
|
my $url="http://us.imdb.com/M/title-exact?".$dbkey; |
413
|
0
|
|
|
|
|
|
return($url); |
414
|
|
|
|
|
|
|
} |
415
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
sub getIDs($$) |
417
|
|
|
|
|
|
|
{ |
418
|
0
|
|
|
0
|
0
|
|
my ($class, $imdbdb)=@_; |
419
|
0
|
|
|
|
|
|
my @ids; |
420
|
|
|
|
|
|
|
|
421
|
0
|
|
|
|
|
|
my $res=$imdbdb->dbh->selectall_arrayref("SELECT ".DB_KEY." FROM ".DB_TABLE." ORDER BY ".DB_KEY.""); |
422
|
0
|
0
|
|
|
|
|
if ( !defined($res) ) { |
423
|
0
|
|
|
|
|
|
return(@ids); |
424
|
|
|
|
|
|
|
} |
425
|
|
|
|
|
|
|
|
426
|
0
|
|
|
|
|
|
for my $list (@$res) { |
427
|
0
|
|
|
|
|
|
push(@ids, $list->[0]); |
428
|
|
|
|
|
|
|
} |
429
|
0
|
|
|
|
|
|
return(@ids); |
430
|
|
|
|
|
|
|
} |
431
|
|
|
|
|
|
|
|
432
|
|
|
|
|
|
|
=head1 AUTHOR |
433
|
|
|
|
|
|
|
|
434
|
|
|
|
|
|
|
jerryv, C<< >> |
435
|
|
|
|
|
|
|
|
436
|
|
|
|
|
|
|
=head1 BUGS |
437
|
|
|
|
|
|
|
|
438
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through |
439
|
|
|
|
|
|
|
the web interface at L. I will be notified, and then you'll |
440
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
441
|
|
|
|
|
|
|
|
442
|
|
|
|
|
|
|
|
443
|
|
|
|
|
|
|
|
444
|
|
|
|
|
|
|
|
445
|
|
|
|
|
|
|
=head1 SUPPORT |
446
|
|
|
|
|
|
|
|
447
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
448
|
|
|
|
|
|
|
|
449
|
|
|
|
|
|
|
perldoc IMDB::Local::Title |
450
|
|
|
|
|
|
|
|
451
|
|
|
|
|
|
|
|
452
|
|
|
|
|
|
|
You can also look for information at: |
453
|
|
|
|
|
|
|
|
454
|
|
|
|
|
|
|
=over 4 |
455
|
|
|
|
|
|
|
|
456
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker (report bugs here) |
457
|
|
|
|
|
|
|
|
458
|
|
|
|
|
|
|
L |
459
|
|
|
|
|
|
|
|
460
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
461
|
|
|
|
|
|
|
|
462
|
|
|
|
|
|
|
L |
463
|
|
|
|
|
|
|
|
464
|
|
|
|
|
|
|
=item * CPAN Ratings |
465
|
|
|
|
|
|
|
|
466
|
|
|
|
|
|
|
L |
467
|
|
|
|
|
|
|
|
468
|
|
|
|
|
|
|
=item * Search CPAN |
469
|
|
|
|
|
|
|
|
470
|
|
|
|
|
|
|
L |
471
|
|
|
|
|
|
|
|
472
|
|
|
|
|
|
|
=back |
473
|
|
|
|
|
|
|
|
474
|
|
|
|
|
|
|
|
475
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
476
|
|
|
|
|
|
|
|
477
|
|
|
|
|
|
|
|
478
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
479
|
|
|
|
|
|
|
|
480
|
|
|
|
|
|
|
Copyright 2015 jerryv. |
481
|
|
|
|
|
|
|
|
482
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
483
|
|
|
|
|
|
|
under the terms of the the Artistic License (2.0). You may obtain a |
484
|
|
|
|
|
|
|
copy of the full license at: |
485
|
|
|
|
|
|
|
|
486
|
|
|
|
|
|
|
L |
487
|
|
|
|
|
|
|
|
488
|
|
|
|
|
|
|
Any use, modification, and distribution of the Standard or Modified |
489
|
|
|
|
|
|
|
Versions is governed by this Artistic License. By using, modifying or |
490
|
|
|
|
|
|
|
distributing the Package, you accept this license. Do not use, modify, |
491
|
|
|
|
|
|
|
or distribute the Package, if you do not accept this license. |
492
|
|
|
|
|
|
|
|
493
|
|
|
|
|
|
|
If your Modified Version has been derived from a Modified Version made |
494
|
|
|
|
|
|
|
by someone other than you, you are nevertheless required to ensure that |
495
|
|
|
|
|
|
|
your Modified Version complies with the requirements of this license. |
496
|
|
|
|
|
|
|
|
497
|
|
|
|
|
|
|
This license does not grant you the right to use any trademark, service |
498
|
|
|
|
|
|
|
mark, tradename, or logo of the Copyright Holder. |
499
|
|
|
|
|
|
|
|
500
|
|
|
|
|
|
|
This license includes the non-exclusive, worldwide, free-of-charge |
501
|
|
|
|
|
|
|
patent license to make, have made, use, offer to sell, sell, import and |
502
|
|
|
|
|
|
|
otherwise transfer the Package with respect to any patent claims |
503
|
|
|
|
|
|
|
licensable by the Copyright Holder that are necessarily infringed by the |
504
|
|
|
|
|
|
|
Package. If you institute patent litigation (including a cross-claim or |
505
|
|
|
|
|
|
|
counterclaim) against any party alleging that the Package constitutes |
506
|
|
|
|
|
|
|
direct or contributory patent infringement, then this Artistic License |
507
|
|
|
|
|
|
|
to you shall terminate on the date that such litigation is filed. |
508
|
|
|
|
|
|
|
|
509
|
|
|
|
|
|
|
Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER |
510
|
|
|
|
|
|
|
AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. |
511
|
|
|
|
|
|
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR |
512
|
|
|
|
|
|
|
PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY |
513
|
|
|
|
|
|
|
YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR |
514
|
|
|
|
|
|
|
CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR |
515
|
|
|
|
|
|
|
CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, |
516
|
|
|
|
|
|
|
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
517
|
|
|
|
|
|
|
|
518
|
|
|
|
|
|
|
|
519
|
|
|
|
|
|
|
=cut |
520
|
|
|
|
|
|
|
|
521
|
|
|
|
|
|
|
1; # End of IMDB::Local::Title |