IMDB/Title.pm

filter: Statementstmt 14.7% 82 / 557 Branchbran 0.0% 0 / 130 Conditioncond 0.0% 0 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 21.4% 26 / 121 Podpod 80.0% 36 / 45 totaltotal 16.7% 144 / 861 CC 68 SCAR 30.3
CC
68
Cov
12%
_url
210.0
_get_id
30.0
synopsis
20.0
CRAP 20.6
« IMDB/UserComment.pm ↑ Summary IMDB/CreditList.pm »
1 # $Id: Title.pm 7370 2012-04-09 01:17:33Z chris $
2  
3 =head1 NAME
4  
5 WebService::IMDB::Title
6  
7 =cut
8  
9 package WebService::IMDB::Title;
10  
11 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 2 our $VERSION = '0.05';
15  
16 2 ▶use base qw(WebService::IMDB::Base);
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 2 our @CARP_NOT = qw(WebService::IMDB);
20  
21 2 ▶use HTTP::Request::Common;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 2 ▶use URI;
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 2 ▶use WebService::IMDB::Certificate;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 2 ▶use WebService::IMDB::Credit;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 2 ▶use WebService::IMDB::CreditList;
Subroutine BEGIN: called CC=1 SCAR=0.0
28 2 ▶use WebService::IMDB::Date;
Subroutine BEGIN: called CC=1 SCAR=0.0
29 2 ▶use WebService::IMDB::Goof;
Subroutine BEGIN: called CC=1 SCAR=0.0
30 2 ▶use WebService::IMDB::Image;
Subroutine BEGIN: called CC=1 SCAR=0.0
31 2 ▶use WebService::IMDB::News;
Subroutine BEGIN: called CC=1 SCAR=0.0
32 2 ▶use WebService::IMDB::ParentalGuideItem;
Subroutine BEGIN: called CC=1 SCAR=0.0
33 2 ▶use WebService::IMDB::Photo;
Subroutine BEGIN: called CC=1 SCAR=0.0
34 2 ▶use WebService::IMDB::Plot;
Subroutine BEGIN: called CC=1 SCAR=0.0
35 2 ▶use WebService::IMDB::Quote;
Subroutine BEGIN: called CC=1 SCAR=0.0
36 2 ▶use WebService::IMDB::Review;
Subroutine BEGIN: called CC=1 SCAR=0.0
37 2 ▶use WebService::IMDB::Runtime;
Subroutine BEGIN: called CC=1 SCAR=0.0
38 2 ▶use WebService::IMDB::Season;
Subroutine BEGIN: called CC=1 SCAR=0.0
39 2 ▶use WebService::IMDB::Title::Stub;
Subroutine BEGIN: called CC=1 SCAR=0.0
40 2 ▶use WebService::IMDB::Trailer;
Subroutine BEGIN: called CC=1 SCAR=0.0
41 2 ▶use WebService::IMDB::Trivium;
Subroutine BEGIN: called CC=1 SCAR=0.0
42 2 ▶use WebService::IMDB::UserComment;
Subroutine BEGIN: called CC=1 SCAR=0.0
43  
44 2 __PACKAGE__->mk_accessors(qw(
45 __cast_summary
46 __certificate
47 __creators
48 __credits
49 __directors_summary
50 __goofs
51 __image
52 __news
53 __parental_guide
54 __photos
55 __plots
56 __quote
57 __quotes
58 __release_date
59 __reviews
60 __runtime
61 __seasons
62 __series
63 __trailer
64 __trivia
65 __user_comment
66 __user_comments
67 __writers_summary
68 ));
69  
70 2 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
71 2 PAGE_MAINDETAILS => 1,
72 PAGE_EXTERNAL_REVIEWS => 2,
73 PAGE_EPISODES => 3,
74 PAGE_FULLCREDITS => 4,
75 PAGE_GOOFS => 5,
76 PAGE_NEWS => 6,
77 PAGE_PARENTALGUIDE => 7,
78 PAGE_PHOTOS => 8,
79 PAGE_PLOT => 9,
80 PAGE_QUOTES => 10,
81 PAGE_SYNOPSIS => 11,
82 PAGE_TRIVIA => 12,
83 PAGE_USERCOMMENTS => 13,
84  
85 PAGE_LAST => 13,
86 2 };
87  
88 # Also:
89 # 'more_cast',
90 # 'more_writers',
91 # 'more_plot',
92  
93  
94 =head1 METHODS
95  
96 =head2 tconst
97  
98 =head2 cast_summary
99  
100 =head2 certificate
101  
102 =head2 creators
103  
104 =head2 credits
105  
106 =head2 directors_summary
107  
108 =head2 genres
109  
110 =head2 goof
111  
112 =head2 goofs
113  
114 =head2 image
115  
116 =head2 news
117  
118 =head2 num_votes
119  
120 =head2 outline_plot
121  
122 =head2 parental_guide
123  
124 =head2 photos
125  
126 =head2 plots
127  
128 =head2 production_status
129  
130 =head2 quote
131  
132 =head2 quotes
133  
134 =head2 rating
135  
136 =head2 release_date
137  
138 =head2 reviews
139  
140 =head2 runtime
141  
142 =head2 seasons
143  
144 =head2 series
145  
146 =head2 synopsis
147  
148 =head2 tagline
149  
150 =head2 title
151  
152 =head2 trailer
153  
154 =head2 trivia
155  
156 =head2 trivium
157  
158 =head2 type
159  
160 =head2 user_comment
161  
162 =head2 user_comments
163  
164 =head2 writers_summary
165  
166 =head2 year
167  
168 =cut
169  
170  
171 ################################
172 #
173 # Primary properties
174 #
175 ################################
176  
177 0 ▶sub _url {
Subroutine _url: not called CC=14 SCAR=53.5
178 0 my $self = shift;
179 0 my $page = shift;
180  
181 0 my $uri = URI->new();
182 0 $uri->scheme("http");
183 0 $uri->host($self->_domain());
184 0 ▶ if ($page == PAGE_MAINDETAILS) {
Branch: 13 branches
BranchTrueFalseTotal
if ($page == 1) { } 0 0 0
elsif ($page == 2) { } 0 0 0
elsif ($page == 3) { } 0 0 0
elsif ($page == 4) { } 0 0 0
elsif ($page == 5) { } 0 0 0
elsif ($page == 6) { } 0 0 0
elsif ($page == 7) { } 0 0 0
elsif ($page == 8) { } 0 0 0
elsif ($page == 9) { } 0 0 0
elsif ($page == 10) { } 0 0 0
elsif ($page == 11) { } 0 0 0
elsif ($page == 12) { } 0 0 0
elsif ($page == 13) { } 0 0 0
185 0 $uri->path(sprintf("/title/%s/maindetails", $self->_id()));
186 } elsif ($page == PAGE_EXTERNAL_REVIEWS) {
187 0 $uri->path("/title/external_reviews");
188 0 $uri->query_form('tconst' => $self->_id());
189 } elsif ($page == PAGE_EPISODES) {
190 0 $uri->path("/title/episodes");
191 0 $uri->query_form('tconst' => $self->_id());
192 } elsif ($page == PAGE_FULLCREDITS) {
193 0 $uri->path("/title/fullcredits");
194 0 $uri->query_form('tconst' => $self->_id());
195 } elsif ($page == PAGE_GOOFS) {
196 0 $uri->path("/title/goofs");
197 0 $uri->query_form('tconst' => $self->_id());
198 } elsif ($page == PAGE_NEWS) {
199 0 $uri->path(sprintf("/title/%s/news", $self->_id()));
200 } elsif ($page == PAGE_PARENTALGUIDE) {
201 0 $uri->path("/title/parentalguide");
202 0 $uri->query_form('tconst' => $self->_id());
203 } elsif ($page == PAGE_PHOTOS) {
204 0 $uri->path("/title/photos");
205 0 $uri->query_form('tconst' => $self->_id());
206 } elsif ($page == PAGE_PLOT) {
207 0 $uri->path("/title/plot");
208 0 $uri->query_form('tconst' => $self->_id());
209 } elsif ($page == PAGE_QUOTES) {
210 0 $uri->path("/title/quotes");
211 0 $uri->query_form('tconst' => $self->_id());
212 } elsif ($page == PAGE_SYNOPSIS) {
213 0 $uri->path("/title/synopsis");
214 0 $uri->query_form('tconst' => $self->_id());
215 } elsif ($page == PAGE_TRIVIA) {
216 0 $uri->path("/title/trivia");
217 0 $uri->query_form('tconst' => $self->_id());
218 } elsif ($page == PAGE_USERCOMMENTS) {
219 0 $uri->path("/title/usercomments");
220 0 $uri->query_form('tconst' => $self->_id(), "limit" => 20); # TODO: Should perhaps be higher?
221 }
222  
223 0 return $uri->as_string();
224 }
225  
226  
227 0 ▶sub tconst {
Subroutine tconst: not called CC=1 SCAR=6.9
Pod documented
228 0 my $self = shift;
229 0 return $self->_content(PAGE_MAINDETAILS)->{'tconst'};
230 }
231  
232 0 ▶sub cast_summary {
Subroutine cast_summary: not called CC=1 SCAR=6.9
Pod documented
233 0 my $self = shift;
234 0 return $self->_cast_summary();
235 }
236  
237 0 ▶sub certificate {
Subroutine certificate: not called CC=1 SCAR=6.9
Pod documented
238 0 my $self = shift;
239 0 return $self->_certificate();
240 }
241  
242 0 ▶sub creators {
Subroutine creators: not called CC=1 SCAR=6.9
Pod documented
243 0 my $self = shift;
244 0 return $self->_creators()
245 }
246  
247 0 ▶sub credits {
Subroutine credits: not called CC=1 SCAR=6.9
Pod documented
248 0 my $self = shift;
249 0 return $self->_credits()
250 }
251  
252 0 ▶sub directors_summary {
Subroutine directors_summary: not called CC=1 SCAR=6.9
Pod documented
253 0 my $self = shift;
254 0 return $self->_directors_summary();
255 }
256  
257 0 ▶sub genres {
Subroutine genres: not called CC=2 SCAR=17.9
Pod documented
258 0 my $self = shift;
259 0 ▶ if (exists $self->_content(PAGE_MAINDETAILS)->{'genres'}) { # TODO: Think about how to handle this correctly.
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->_content(1)->{'genres'}) { } 0 0 0
260 0 return [ @{$self->_content(PAGE_MAINDETAILS)->{'genres'}} ];
261 } else {
262 0 return [];
263 }
264 }
265  
266 0 ▶sub goof {
Subroutine goof: not called CC=2 SCAR=17.9
Pod documented
267 0 my $self = shift;
268 0 ▶ if (exists $self->_content(PAGE_MAINDETAILS)->{'goof'}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->_content(1)->{'goof'}) { } 0 0 0
269 0 return $self->_content(PAGE_MAINDETAILS)->{'goof'};
270 } else {
271 0 return undef;
272 }
273 }
274  
275 0 ▶sub goofs {
Subroutine goofs: not called CC=1 SCAR=6.9
Pod documented
276 0 my $self = shift;
277 0 return $self->_goofs();
278 }
279  
280 0 ▶sub image {
Subroutine image: not called CC=1 SCAR=6.9
Pod documented
281 0 my $self = shift;
282 0 return $self->_image();
283 }
284  
285 0 ▶sub news {
Subroutine news: not called CC=1 SCAR=6.9
Pod documented
286 0 my $self = shift;
287 0 return $self->_news();
288 }
289  
290 0 ▶sub num_votes {
Subroutine num_votes: not called CC=2 SCAR=17.9
Pod documented
291 0 my $self = shift;
292 0 ▶ if (exists $self->_content(PAGE_MAINDETAILS)->{'num_votes'}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->_content(1)->{'num_votes'}) { } 0 0 0
293 0 return $self->_content(PAGE_MAINDETAILS)->{'num_votes'};
294 } else {
295 0 return undef;
296 }
297 }
298  
299 0 ▶sub outline_plot {
Subroutine outline_plot: not called CC=3 SCAR=24.8
Pod documented
300 0 my $self = shift;
301 0 ▶ if (exists $self->_content(PAGE_MAINDETAILS)->{'plot'} && exists $self->_content(PAGE_MAINDETAILS)->{'plot'}->{'outline'}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->_content(1)->{'plot'} and exists $self->_content(1)->{'plot'}{'outline'}) { } 0 0 0
Condition0%0/3
exists $self->_content(1)->{"plot"} and exists $self->_content(1)->{"plot"}{"outline"}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $self->_content(1)->{"plot"} and exists $self->_content(1)->{"plot"}{"outline"}
exists $self->_content(1)->{"plot"} exists $self->_content(1)->{"plot"}{"outline"}
Truth table0%0/3
A and B
A= exists $self->_content(1)->{"plot"}B= exists $self->_content(1)->{"plot"}{"outline"}
ABresult
0X0
100
111
302 0 return $self->_content(PAGE_MAINDETAILS)->{'plot'}->{'outline'};
303 } else {
304 0 return undef;
305 }
306 }
307  
308 0 ▶sub parental_guide {
Subroutine parental_guide: not called CC=1 SCAR=6.9
Pod documented
309 0 my $self = shift;
310 0 return $self->_parental_guide();
311 }
312  
313 0 ▶sub photos {
Subroutine photos: not called CC=1 SCAR=6.9
Pod documented
314 0 my $self = shift;
315 0 return $self->_photos();
316 }
317  
318 0 ▶sub plots {
Subroutine plots: not called CC=1 SCAR=6.9
Pod documented
319 0 my $self = shift;
320 0 return $self->_plots();
321 }
322  
323 0 ▶sub production_status {
Subroutine production_status: not called CC=2 SCAR=17.9
Pod documented
324 0 my $self = shift;
325 0 ▶ if (exists $self->_content(PAGE_MAINDETAILS)->{'production_status'}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->_content(1)->{'production_status'}) { } 0 0 0
326 0 return $self->_content(PAGE_MAINDETAILS)->{'production_status'};
327 } else {
328 0 return undef;
329 }
330 }
331  
332 0 ▶sub quote {
Subroutine quote: not called CC=1 SCAR=6.9
Pod documented
333 0 my $self = shift;
334 0 return $self->_quote();
335 }
336  
337 0 ▶sub quotes {
Subroutine quotes: not called CC=1 SCAR=6.9
Pod documented
338 0 my $self = shift;
339 0 return $self->_quotes();
340 }
341  
342 0 ▶sub rating {
Subroutine rating: not called CC=2 SCAR=17.9
Pod documented
343 0 my $self = shift;
344 0 ▶ if (exists $self->_content(PAGE_MAINDETAILS)->{'rating'}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->_content(1)->{'rating'}) { } 0 0 0
345 0 return $self->_content(PAGE_MAINDETAILS)->{'rating'};
346 } else {
347 0 return undef;
348 }
349 }
350  
351 0 ▶sub release_date {
Subroutine release_date: not called CC=1 SCAR=6.9
Pod documented
352 0 my $self = shift;
353 0 return $self->_release_date();
354 }
355  
356 0 ▶sub reviews { # Should be "external_reviews"?
Subroutine reviews: not called CC=1 SCAR=6.9
Pod documented
357 0 my $self = shift;
358 0 return $self->_reviews();
359 }
360  
361 0 ▶sub runtime {
Subroutine runtime: not called CC=1 SCAR=6.9
Pod documented
362 0 my $self = shift;
363 0 return $self->_runtime();
364 }
365  
366 0 ▶sub seasons {
Subroutine seasons: not called CC=1 SCAR=6.9
Pod documented
367 0 my $self = shift;
368 0 return $self->_seasons();
369 }
370  
371 0 ▶sub series {
Subroutine series: not called CC=1 SCAR=6.9
Pod documented
372 0 my $self = shift;
373 0 return $self->_series();
374 }
375  
376 0 ▶sub synopsis {
Subroutine synopsis: not called CC=4 SCAR=30.0
Pod documented
377 0 my $self = shift;
378  
379 # We can't rely on $self->_content(PAGE_MAINDETAILS)->{'has'}; it doesn't always have synopsis present, even for titles that do
380 # return a synopsis in $self->_content(PAGE_SYNOPSIS) (e.g. tt0036342). For titles that don't have a synopsis, $self->_content(PAGE_SYNOPSIS)
381 # can either return a hash without a 'text' key, or returns a 404 status (e.g. http://app.imdb.com/title/synopsis?tconst=tt0035015)
382 # hence we test for both these cases.
383 0 my $content;
384 0 eval {
385 0 $content = $self->_content(PAGE_SYNOPSIS);
386 };
387  
388 0 ▶ if ($@ =~ m/404/) {
Branch: 3 branches
BranchTrueFalseTotal
if ($@ =~ /404/) { } 0 0 0
elsif ($@) { } 0 0 0
elsif (exists $content->{'text'}) { } 0 0 0
389 0 $@ = "";
390 0 return undef;
391 } elsif ($@) {
392 0 die $@;
393 } elsif (exists $content->{'text'}) {
394 0 return $content->{'text'};
395 } else {
396 0 return undef;
397 }
398  
399 }
400  
401 0 ▶sub tagline {
Subroutine tagline: not called CC=2 SCAR=17.9
Pod documented
402 0 my $self = shift;
403 0 ▶ if (exists $self->_content(PAGE_MAINDETAILS)->{'tagline'}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->_content(1)->{'tagline'}) { } 0 0 0
404 0 return $self->_content(PAGE_MAINDETAILS)->{'tagline'};
405 } else {
406 0 return undef;
407 }
408 }
409  
410 0 ▶sub title {
Subroutine title: not called CC=1 SCAR=6.9
Pod documented
411 0 my $self = shift;
412 0 return $self->_content(PAGE_MAINDETAILS)->{'title'};
413 }
414  
415 0 ▶sub trailer {
Subroutine trailer: not called CC=1 SCAR=6.9
Pod documented
416 0 my $self = shift;
417 0 return $self->_trailer();
418 }
419  
420 0 ▶sub trivia {
Subroutine trivia: not called CC=1 SCAR=6.9
Pod documented
421 0 my $self = shift;
422 0 return $self->_trivia();
423 }
424  
425 0 ▶sub trivium {
Subroutine trivium: not called CC=2 SCAR=17.9
Pod documented
426 0 my $self = shift;
427 0 ▶ if (exists $self->_content(PAGE_MAINDETAILS)->{'trivium'}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->_content(1)->{'trivium'}) { } 0 0 0
428 0 return $self->_content(PAGE_MAINDETAILS)->{'trivium'};
429 } else {
430 0 return undef;
431 }
432 }
433  
434 0 ▶sub type {
Subroutine type: not called CC=1 SCAR=6.9
Pod documented
435 0 my $self = shift;
436 0 return $self->_content(PAGE_MAINDETAILS)->{'type'};
437 }
438  
439 0 ▶sub user_comment {
Subroutine user_comment: not called CC=1 SCAR=6.9
Pod documented
440 0 my $self = shift;
441 0 return $self->_user_comment();
442 }
443  
444 0 ▶sub user_comments {
Subroutine user_comments: not called CC=1 SCAR=6.9
Pod documented
445 0 my $self = shift;
446 0 return $self->_user_comments();
447 }
448  
449 0 ▶sub writers_summary {
Subroutine writers_summary: not called CC=1 SCAR=6.9
Pod documented
450 0 my $self = shift;
451 0 return $self->_writers_summary();
452 }
453  
454 0 ▶sub year {
Subroutine year: not called CC=1 SCAR=6.9
Pod documented
455 0 my $self = shift;
456 0 return $self->_content(PAGE_MAINDETAILS)->{'year'};
457 }
458  
459  
460 # Temporary aliases for soem IMDB::Film methods
461  
462 0 ▶sub plot {
Subroutine plot: not called CC=1 SCAR=6.9
Pod undocumented
463 0 my $self = shift;
464 0 return $self->outline_plot();
465 }
466  
467 0 ▶sub full_plot {
Subroutine full_plot: not called CC=2 SCAR=17.9
Pod undocumented
468 0 my $self = shift;
469 0 ▶ if (scalar @{$self->plots()}) {
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @{$self->plots;}) { } 0 0 0
470 0 return $self->plots()->[0]->text();
471 } else {
472 0 return undef;
473 }
474 }
475  
476  
477  
478  
479 0 ▶sub language {
Subroutine language: not called CC=1 SCAR=6.9
Pod undocumented
480 0 return undef;
481 }
482  
483 0 ▶sub company {
Subroutine company: not called CC=1 SCAR=6.9
Pod undocumented
484 0 return undef;
485 }
486  
487 0 ▶sub directors {
Subroutine directors: not called CC=1 SCAR=6.9
Pod undocumented
488 0 return undef;
489 }
490  
491 0 ▶sub cast {
Subroutine cast: not called CC=1 SCAR=6.9
Pod undocumented
492 0 return undef;
493 }
494  
495 0 ▶sub certifications {
Subroutine certifications: not called CC=1 SCAR=6.9
Pod undocumented
496 0 return undef;
497 }
498  
499 0 ▶sub duration {
Subroutine duration: not called CC=1 SCAR=6.9
Pod undocumented
500 0 return undef;
501 }
502  
503 0 ▶sub episodeof {
Subroutine episodeof: not called CC=2 SCAR=17.9
Pod undocumented
504 0 my $self = shift;
505 0 ▶ if (defined $self->series()) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->series) { } 0 0 0
506 0 return [{'id' => substr($self->series()->tconst(), 2)}];
507 } else {
508 0 return undef;
509 }
510 }
511  
512 ################################
513 #
514 # Caching accessors
515 #
516 ################################
517  
518 0 ▶sub _flush {
Subroutine _flush: not called CC=1 SCAR=6.9
519 0 my $self = shift;
520  
521 0 $self->SUPER::_flush();
522  
523 0 $self->__cast_summary(undef);
524 0 $self->__certificate(undef);
525 0 $self->__creators(undef);
526 0 $self->__credits(undef);
527 0 $self->__directors_summary(undef);
528 0 $self->__goofs(undef);
529 0 $self->__image(undef);
530 0 $self->__news(undef);
531 0 $self->__parental_guide(undef);
532 0 $self->__photos(undef);
533 0 $self->__plots(undef);
534 0 $self->__quote(undef);
535 0 $self->__quotes(undef);
536 0 $self->__release_date(undef);
537 0 $self->__reviews(undef);
538 0 $self->__runtime(undef);
539 0 $self->__seasons(undef);
540 0 $self->__series(undef);
541 0 $self->__trailer(undef);
542 0 $self->__trivia(undef);
543 0 $self->__user_comment(undef);
544 0 $self->__user_comments(undef);
545 0 $self->__writers_summary(undef);
546 }
547  
548 0 ▶sub _cast_summary {
Subroutine _cast_summary: not called CC=2 SCAR=17.9
549 0 my $self = shift;
550  
551 0 ▶ if (!defined $self->__cast_summary()) { $self->__cast_summary($self->_get_cast_summary()); }
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->__cast_summary) 0 0 0
552 0 return $self->__cast_summary();
553 }
554  
555 0 ▶sub _certificate {
Subroutine _certificate: not called CC=2 SCAR=17.9
556 0 my $self = shift;
557  
558 0 ▶ if (!defined $self->__certificate()) { $self->__certificate([$self->_get_certificate()]); } # Wrap in array, because we need to cache undef too
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->__certificate) 0 0 0
559 0 return $self->__certificate()->[0];
560 }
561  
562 0 ▶sub _creators {
Subroutine _creators: not called CC=2 SCAR=17.9
563 0 my $self = shift;
564  
565 0 ▶ if (!defined $self->__creators()) { $self->__creators($self->_get_creators()); }
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->__creators) 0 0 0
566 0 return $self->__creators();
567 }
568  
569 0 ▶sub _credits {
Subroutine _credits: not called CC=2 SCAR=17.9
570 0 my $self = shift;
571  
572 0 ▶ if (!defined $self->__credits()) { $self->__credits($self->_get_credits()); }
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->__credits) 0 0 0
573 0 return $self->__credits();
574 }
575  
576 0 ▶sub _directors_summary {
Subroutine _directors_summary: not called CC=2 SCAR=17.9
577 0 my $self = shift;
578  
579 0 ▶ if (!defined $self->__directors_summary()) { $self->__directors_summary($self->_get_directors_summary()); }
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->__directors_summary) 0 0 0
580 0 return $self->__directors_summary();
581 }
582  
583 0 ▶sub _goofs {
Subroutine _goofs: not called CC=2 SCAR=17.9
584 0 my $self = shift;
585  
586 0 ▶ if (!defined $self->__goofs()) { $self->__goofs($self->_get_goofs()); }
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->__goofs) 0 0 0
587 0 return $self->__goofs();
588 }
589  
590 0 ▶sub _image {
Subroutine _image: not called CC=2 SCAR=17.9
591 0 my $self = shift;
592  
593 0 ▶ if (!defined $self->__image()) { $self->__image([$self->_get_image()]); } # Wrap in array, because we need to cache undef too
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->__image) 0 0 0
594 0 return $self->__image()->[0];
595 }
596  
597 0 ▶sub _news {
Subroutine _news: not called CC=2 SCAR=17.9
598 0 my $self = shift;
599  
600 0 ▶ if (!defined $self->__news()) { $self->__news($self->_get_news()); }
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->__news) 0 0 0
601 0 return $self->__news();
602 }
603  
604 0 ▶sub _parental_guide {
Subroutine _parental_guide: not called CC=2 SCAR=17.9
605 0 my $self = shift;
606  
607 0 ▶ if (!defined $self->__parental_guide()) { $self->__parental_guide($self->_get_parental_guide()); }
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->__parental_guide) 0 0 0
608 0 return $self->__parental_guide();
609 }
610  
611 0 ▶sub _photos {
Subroutine _photos: not called CC=2 SCAR=17.9
612 0 my $self = shift;
613  
614 0 ▶ if (!defined $self->__photos()) { $self->__photos($self->_get_photos()); }
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->__photos) 0 0 0
615 0 return $self->__photos();
616 }
617  
618 0 ▶sub _plots {
Subroutine _plots: not called CC=2 SCAR=17.9
619 0 my $self = shift;
620  
621 0 ▶ if (!defined $self->__plots()) { $self->__plots($self->_get_plots()); }
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->__plots) 0 0 0
622 0 return $self->__plots();
623 }
624  
625 0 ▶sub _quote {
Subroutine _quote: not called CC=2 SCAR=17.9
626 0 my $self = shift;
627  
628 0 ▶ if (!defined $self->__quote()) { $self->__quote([$self->_get_quote()]); } # Wrap in array, because we need to cache undef too
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->__quote) 0 0 0
629 0 return $self->__quote()->[0];
630 }
631  
632 0 ▶sub _quotes {
Subroutine _quotes: not called CC=2 SCAR=17.9
633 0 my $self = shift;
634  
635 0 ▶ if (!defined $self->__quotes()) { $self->__quotes($self->_get_quotes()); }
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->__quotes) 0 0 0
636 0 return $self->__quotes();
637 }
638  
639 0 ▶sub _release_date {
Subroutine _release_date: not called CC=2 SCAR=17.9
640 0 my $self = shift;
641  
642 0 ▶ if (!defined $self->__release_date()) { $self->__release_date([$self->_get_release_date()]); } # Wrap in array, because we need to cache undef too
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->__release_date) 0 0 0
643 0 return $self->__release_date()->[0];
644 }
645  
646 0 ▶sub _reviews {
Subroutine _reviews: not called CC=2 SCAR=17.9
647 0 my $self = shift;
648  
649 0 ▶ if (!defined $self->__reviews()) { $self->__reviews($self->_get_reviews()); }
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->__reviews) 0 0 0
650 0 return $self->__reviews();
651 }
652  
653 0 ▶sub _runtime {
Subroutine _runtime: not called CC=2 SCAR=17.9
654 0 my $self = shift;
655  
656 0 ▶ if (!defined $self->__runtime()) { $self->__runtime([$self->_get_runtime()]); } # Wrap in array, because we need to cache undef too
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->__runtime) 0 0 0
657 0 return $self->__runtime()->[0];
658 }
659  
660 0 ▶sub _seasons {
Subroutine _seasons: not called CC=2 SCAR=17.9
661 0 my $self = shift;
662  
663 0 ▶ if (!defined $self->__seasons()) { $self->__seasons($self->_get_seasons()); }
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->__seasons) 0 0 0
664 0 return $self->__seasons();
665 }
666  
667 0 ▶sub _series {
Subroutine _series: not called CC=2 SCAR=17.9
668 0 my $self = shift;
669  
670 0 ▶ if (!defined $self->__series()) { $self->__series([$self->_get_series()]); } # Wrap in array, because we need to cache undef too
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->__series) 0 0 0
671 0 return $self->__series()->[0];
672 }
673  
674 0 ▶sub _trailer {
Subroutine _trailer: not called CC=2 SCAR=17.9
675 0 my $self = shift;
676  
677 0 ▶ if (!defined $self->__trailer()) { $self->__trailer([$self->_get_trailer()]); } # Wrap in array, because we need to cache undef too
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->__trailer) 0 0 0
678 0 return $self->__trailer()->[0];
679 }
680  
681 0 ▶sub _trivia {
Subroutine _trivia: not called CC=2 SCAR=17.9
682 0 my $self = shift;
683  
684 0 ▶ if (!defined $self->__trivia()) { $self->__trivia($self->_get_trivia()); }
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->__trivia) 0 0 0
685 0 return $self->__trivia();
686 }
687  
688 0 ▶sub _user_comment {
Subroutine _user_comment: not called CC=2 SCAR=17.9
689 0 my $self = shift;
690  
691 0 ▶ if (!defined $self->__user_comment()) { $self->__user_comment([$self->_get_user_comment()]); } # Wrap in array, because we need to cache undef too
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->__user_comment) 0 0 0
692 0 return $self->__user_comment()->[0];
693 }
694  
695 0 ▶sub _user_comments {
Subroutine _user_comments: not called CC=2 SCAR=17.9
696 0 my $self = shift;
697  
698 0 ▶ if (!defined $self->__user_comments()) { $self->__user_comments($self->_get_user_comments()); }
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->__user_comments) 0 0 0
699 0 return $self->__user_comments();
700 }
701  
702 0 ▶sub _writers_summary {
Subroutine _writers_summary: not called CC=2 SCAR=17.9
703 0 my $self = shift;
704  
705 0 ▶ if (!defined $self->__writers_summary()) { $self->__writers_summary($self->_get_writers_summary()); }
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->__writers_summary) 0 0 0
706 0 return $self->__writers_summary();
707 }
708  
709  
710 ################################
711 #
712 # Parsing methods
713 #
714 ################################
715  
716 0 ▶sub _get_id {
Subroutine _get_id: not called CC=5 SCAR=34.0
717 0 my $self = shift;
718  
719 0 my $tconst;
720  
721 0 ▶ if (exists $self->_q()->{'tconst'}) {
Branch: 2 branches
BranchTrueFalseTotal
if (exists $self->_q->{'tconst'}) { } 0 0 0
elsif (exists $self->_q->{'imdbid'}) { } 0 0 0
722 0 $tconst = $self->_q()->{'tconst'}
723 } elsif (exists $self->_q()->{'imdbid'}) {
724 0 my $imdbid = $self->_q()->{'imdbid'};
725 0 ▶ my ($id) = $imdbid =~ m/^(?:tt)?(\d+)$/ or die "Failed to parse '$imdbid'";
Branch: 1 branch
BranchTrueFalseTotal
my($id) = $imdbid =~ /^(?:tt)?(\d+)$/ or die "Failed to parse '${imdbid}'" 0 0 0
726 0 $tconst = sprintf("tt%07d", $id);
727 } else {
728 0 croak "No valid search criteria";
729 }
730  
731 # The constructor calls _get_id to validate the supplied id too, such that a
732 # successful return from the constructor is indicative that the id is valid, and
733 # that the resource exists. We do that by trying to use the supplied id to
734 # fetch the resource.
735  
736 0 my $uri = URI->new();
737 0 $uri->scheme("http");
738 0 $uri->host($self->_domain());
739 0 $uri->path(sprintf("/title/%s/maindetails", $tconst));
740  
741 0 my $content = $self->_ws()->_response_decoded_json(GET $uri->as_string());
742  
743 0 ▶ if ($content->{'tconst'} ne $tconst) {
Branch: 1 branch
BranchTrueFalseTotal
if ($content->{"tconst"} ne $tconst) 0 0 0
744 0 die "tconst failed round trip"
745 }
746  
747 0 return $tconst;
748 }
749  
750 0 ▶sub _get_cast_summary {
Subroutine _get_cast_summary: not called CC=1 SCAR=6.9
751 0 my $self = shift;
752  
753 0 return [map {WebService::IMDB::Credit->_new($self->_ws(), $_)} @{$self->_content(PAGE_MAINDETAILS)->{'cast_summary'}}];
754  
755 }
756  
757 0 ▶sub _get_certificate {
Subroutine _get_certificate: not called CC=2 SCAR=17.9
758 0 my $self = shift;
759  
760 0 ▶ if (exists $self->_content(PAGE_MAINDETAILS)->{'certificate'}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->_content(1)->{'certificate'}) { } 0 0 0
761 0 return WebService::IMDB::Certificate->_new($self->_ws(), $self->_content(PAGE_MAINDETAILS)->{'certificate'});
762 } else {
763 0 return undef;
764 }
765  
766 }
767  
768 0 ▶sub _get_creators {
Subroutine _get_creators: not called CC=2 SCAR=17.9
769 0 my $self = shift;
770  
771 0 ▶ if (exists $self->_content(PAGE_MAINDETAILS)->{'creators'}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->_content(1)->{'creators'}) { } 0 0 0
772 0 return [map {WebService::IMDB::Credit->_new($self->_ws(), $_)} @{$self->_content(PAGE_MAINDETAILS)->{'creators'}}];
773 } else {
774 0 return [];
775 }
776  
777 }
778  
779 0 ▶sub _get_credits {
Subroutine _get_credits: not called CC=1 SCAR=6.9
780 0 my $self = shift;
781  
782 0 return [map {WebService::IMDB::CreditList->_new($self->_ws(), $_)} @{$self->_content(PAGE_FULLCREDITS)->{'credits'}}];
783  
784 }
785  
786 0 ▶sub _get_directors_summary {
Subroutine _get_directors_summary: not called CC=1 SCAR=6.9
787 0 my $self = shift;
788  
789 0 return [map {WebService::IMDB::Credit->_new($self->_ws(), $_)} @{$self->_content(PAGE_MAINDETAILS)->{'directors_summary'}}];
790  
791 }
792  
793 0 ▶sub _get_goofs {
Subroutine _get_goofs: not called CC=1 SCAR=6.9
794 0 my $self = shift;
795  
796 return [
797 0 (map {WebService::IMDB::Goof->_new($self->_ws(), $_, 1)} @{$self->_content(PAGE_GOOFS)->{'spoilt'}}),
798 0 (map {WebService::IMDB::Goof->_new($self->_ws(), $_, '')} @{$self->_content(PAGE_GOOFS)->{'unspoilt'}}),
799 ];
800  
801 }
802  
803 0 ▶sub _get_image {
Subroutine _get_image: not called CC=2 SCAR=17.9
804 0 my $self = shift;
805  
806 0 ▶ if (exists $self->_content(PAGE_MAINDETAILS)->{'image'}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->_content(1)->{'image'}) { } 0 0 0
807 0 return WebService::IMDB::Image->_new($self->_ws(), $self->_content(PAGE_MAINDETAILS)->{'image'});
808 } else {
809 0 return undef;
810 }
811  
812 }
813  
814 0 ▶sub _get_news {
Subroutine _get_news: not called CC=3 SCAR=24.8
815 0 my $self = shift;
816  
817 # Handle 500 errors, e.g. for:
818 # http://app.imdb.com/title/tt0095705/news
819 # http://app.imdb.com/title/tt0213847/news
820 # TODO: Is 'has' any more use in avoiding the problem here?
821 0 my $content;
822 0 eval {
823 0 $content = $self->_content(PAGE_NEWS);
824 };
825  
826 0 ▶ if ($@ =~ m/500/) {
Branch: 2 branches
BranchTrueFalseTotal
if ($@ =~ /500/) { } 0 0 0
elsif ($@) { } 0 0 0
827 0 $@ = "";
828 0 return undef;
829 } elsif ($@) {
830 0 die $@;
831 } else {
832 0 return WebService::IMDB::News->_new($self->_ws(), $content);
833 }
834  
835 }
836  
837 0 ▶sub _get_parental_guide {
Subroutine _get_parental_guide: not called CC=1 SCAR=6.9
838 0 my $self = shift;
839  
840 0 return [map { WebService::IMDB::ParentalGuideItem->_new($self->_ws(), $_) } @{$self->_content(PAGE_PARENTALGUIDE)->{'parental_guide'}}];
841  
842 }
843  
844 0 ▶sub _get_photos {
Subroutine _get_photos: not called CC=1 SCAR=6.9
845 0 my $self = shift;
846  
847 0 return [map { WebService::IMDB::Photo->_new($self->_ws(), $_) } @{$self->_content(PAGE_PHOTOS)->{'photos'}}];
848  
849 }
850  
851 0 ▶sub _get_plots {
Subroutine _get_plots: not called CC=1 SCAR=6.9
852 0 my $self = shift;
853  
854 0 return [map {WebService::IMDB::Plot->_new($self->_ws(), $_)} @{$self->_content(PAGE_PLOT)->{'plots'}}];
855  
856 }
857  
858 0 ▶sub _get_quote {
Subroutine _get_quote: not called CC=2 SCAR=17.9
859 0 my $self = shift;
860 0 ▶ if (exists $self->_content(PAGE_MAINDETAILS)->{'quote'}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->_content(1)->{'quote'}) { } 0 0 0
861 0 return WebService::IMDB::Quote->_new($self->_ws(), $self->_content(PAGE_MAINDETAILS)->{'quote'});
862 } else {
863 0 return undef;
864 }
865 }
866  
867 0 ▶sub _get_quotes {
Subroutine _get_quotes: not called CC=1 SCAR=6.9
868 0 my $self = shift;
869  
870 0 return [map {WebService::IMDB::Quote->_new($self->_ws(), $_)} @{$self->_content(PAGE_QUOTES)->{'quotes'}}];
871  
872 }
873  
874 0 ▶sub _get_release_date {
Subroutine _get_release_date: not called CC=2 SCAR=17.9
875 0 my $self = shift;
876  
877 0 ▶ if (exists $self->_content(PAGE_MAINDETAILS)->{'release_date'}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->_content(1)->{'release_date'}) { } 0 0 0
878 0 return WebService::IMDB::Date->_new($self->_ws(), $self->_content(PAGE_MAINDETAILS)->{'release_date'});
879 } else {
880 0 return undef;
881 }
882  
883 }
884  
885 0 ▶sub _get_reviews {
Subroutine _get_reviews: not called CC=1 SCAR=6.9
886 0 my $self = shift;
887  
888 0 return [map {WebService::IMDB::Review->_new($self->_ws(), $_)} @{$self->_content(PAGE_EXTERNAL_REVIEWS)->{'reviews'}}];
889  
890 }
891  
892 0 ▶sub _get_runtime {
Subroutine _get_runtime: not called CC=2 SCAR=17.9
893 0 my $self = shift;
894  
895 0 ▶ if (exists $self->_content(PAGE_MAINDETAILS)->{'runtime'}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->_content(1)->{'runtime'}) { } 0 0 0
896 0 return WebService::IMDB::Runtime->_new($self->_ws(), $self->_content(PAGE_MAINDETAILS)->{'runtime'});
897 } else {
898 0 return undef;
899 }
900  
901 }
902  
903 0 ▶sub _get_seasons {
Subroutine _get_seasons: not called CC=2 SCAR=17.9
904 0 my $self = shift;
905  
906 0 ▶ if (exists $self->_content(PAGE_EPISODES)->{'seasons'}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->_content(3)->{'seasons'}) { } 0 0 0
907 0 return [map {WebService::IMDB::Season->_new($self->_ws(), $_)} @{$self->_content(PAGE_EPISODES)->{'seasons'}}];
908 } else {
909 0 return [];
910 }
911  
912 }
913  
914 0 ▶sub _get_series {
Subroutine _get_series: not called CC=2 SCAR=17.9
915 0 my $self = shift;
916  
917 0 ▶ if (exists $self->_content(PAGE_MAINDETAILS)->{'series'}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->_content(1)->{'series'}) { } 0 0 0
918 0 return WebService::IMDB::Title::Stub->_new($self->_ws(), $self->_content(PAGE_MAINDETAILS)->{'series'});
919 } else {
920 0 return undef;
921 }
922  
923 }
924  
925 0 ▶sub _get_trailer {
Subroutine _get_trailer: not called CC=2 SCAR=17.9
926 0 my $self = shift;
927  
928 0 ▶ if (exists $self->_content(PAGE_MAINDETAILS)->{'trailer'}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->_content(1)->{'trailer'}) { } 0 0 0
929 0 return WebService::IMDB::Trailer->_new($self->_ws(), $self->_content(PAGE_MAINDETAILS)->{'trailer'});
930 } else {
931 0 return undef;
932 }
933  
934 }
935  
936 0 ▶sub _get_trivia {
Subroutine _get_trivia: not called CC=1 SCAR=6.9
937 0 my $self = shift;
938  
939 return [
940 0 (map { WebService::IMDB::Trivium->_new($self->_ws(), $_, 1) } @{$self->_content(PAGE_TRIVIA)->{'spoilt'}}),
941 0 (map { WebService::IMDB::Trivium->_new($self->_ws(), $_, '') } @{$self->_content(PAGE_TRIVIA)->{'unspoilt'}}),
942 ];
943  
944 }
945  
946 0 ▶sub _get_user_comment {
Subroutine _get_user_comment: not called CC=2 SCAR=17.9
947 0 my $self = shift;
948  
949 0 ▶ if (exists $self->_content(PAGE_MAINDETAILS)->{'user_comment'}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->_content(1)->{'user_comment'}) { } 0 0 0
950 0 return WebService::IMDB::UserComment->_new($self->_ws(), $self->_content(PAGE_MAINDETAILS)->{'user_comment'});
951 } else {
952 0 return undef;
953 }
954  
955 }
956  
957 0 ▶sub _get_user_comments {
Subroutine _get_user_comments: not called CC=1 SCAR=6.9
958 0 my $self = shift;
959  
960 0 return [map {WebService::IMDB::UserComment->_new($self->_ws(), $_)} @{$self->_content(PAGE_USERCOMMENTS)->{'user_comments'}}];
961  
962 }
963  
964 0 ▶sub _get_writers_summary {
Subroutine _get_writers_summary: not called CC=1 SCAR=6.9
965 0 my $self = shift;
966  
967 0 return [map {WebService::IMDB::Credit->_new($self->_ws(), $_)} @{$self->_content(PAGE_MAINDETAILS)->{'writers_summary'}}];
968  
969 }
970  
971  
972  
973 ################################
974 #
975 # Debug / dev code
976 #
977 ################################
978  
979 0 ▶sub _unparsed {
Subroutine _unparsed: not called CC=2 SCAR=17.3
980 0 my $self = shift;
981  
982 2 ▶ use Storable qw(dclone);
Subroutine BEGIN: called CC=1 SCAR=0.0
983 0 ▶ my $d = { map {$_ => dclone(eval { $self->_content($_) } || {} )} (1..PAGE_LAST) }; # See comments in synopsis(), _get_news() for why we need eval.
Condition0%0/2
eval { do { $self->_content($_) } } || {}
l!l
00
MC/DC0%0/1
eval { do { $self->_content($_) } } || {}
eval { do { $self->_content($_) } }
Truth table0%0/2
A
A= eval { do { $self->_content($_) } }
Aresult
11
00
984  
985 0 delete $d->{PAGE_MAINDETAILS()}->{'tconst'};
986 0 delete $d->{PAGE_MAINDETAILS()}->{'cast_summary'};
987 0 delete $d->{PAGE_MAINDETAILS()}->{'certificate'};
988 0 delete $d->{PAGE_MAINDETAILS()}->{'creators'};
989 0 delete $d->{PAGE_FULLCREDITS()}->{'credits'};
990 0 delete $d->{PAGE_MAINDETAILS()}->{'directors_summary'};
991 0 delete $d->{PAGE_MAINDETAILS()}->{'genres'};
992 0 delete $d->{PAGE_MAINDETAILS()}->{'image'};
993 0 delete $d->{PAGE_MAINDETAILS()}->{'goof'};
994 0 delete $d->{PAGE_GOOFS()}->{'spoilt'};
995 0 delete $d->{PAGE_GOOFS()}->{'unspoilt'};
996 0 delete $d->{PAGE_MAINDETAILS()}->{'title'};
997 0 $d->{PAGE_NEWS()} = {};
998 0 delete $d->{PAGE_MAINDETAILS()}->{'num_votes'};
999 0 delete $d->{PAGE_MAINDETAILS()}->{'plot'}->{'outline'};
1000 0 delete $d->{PAGE_PARENTALGUIDE()}->{'parental_guide'};
1001 0 delete $d->{PAGE_PHOTOS()}->{'photos'};
1002 0 delete $d->{PAGE_PLOT()}->{'plots'};
1003 0 delete $d->{PAGE_MAINDETAILS()}->{'production_status'};
1004 0 delete $d->{PAGE_MAINDETAILS()}->{'quote'};
1005 0 delete $d->{PAGE_QUOTES()}->{'quotes'};
1006 0 delete $d->{PAGE_MAINDETAILS()}->{'rating'};
1007 0 delete $d->{PAGE_MAINDETAILS()}->{'release_date'};
1008 0 delete $d->{PAGE_EXTERNAL_REVIEWS()}->{'reviews'};
1009 0 delete $d->{PAGE_MAINDETAILS()}->{'runtime'};
1010 0 delete $d->{PAGE_EPISODES()}->{'seasons'};
1011 0 delete $d->{PAGE_MAINDETAILS()}->{'series'};
1012 0 delete $d->{PAGE_SYNOPSIS()}->{'text'};
1013 0 delete $d->{PAGE_MAINDETAILS()}->{'tagline'};
1014 0 delete $d->{PAGE_MAINDETAILS()}->{'title'};
1015 0 delete $d->{PAGE_MAINDETAILS()}->{'trailer'};
1016 0 delete $d->{PAGE_TRIVIA()}->{'spoilt'};
1017 0 delete $d->{PAGE_TRIVIA()}->{'unspoilt'};
1018 0 delete $d->{PAGE_MAINDETAILS()}->{'trivium'};
1019 0 delete $d->{PAGE_MAINDETAILS()}->{'type'};
1020 0 delete $d->{PAGE_MAINDETAILS()}->{'user_comment'};
1021 0 delete $d->{PAGE_USERCOMMENTS()}->{'user_comments'};
1022 0 delete $d->{PAGE_MAINDETAILS()}->{'writers_summary'};
1023 0 delete $d->{PAGE_MAINDETAILS()}->{'year'};
1024  
1025 # TODO: Check that these really aren't required
1026 0 delete $d->{PAGE_MAINDETAILS()}->{'can_rate'}; # What is this?
1027 0 delete $d->{PAGE_MAINDETAILS()}->{'has'};
1028 0 delete $d->{PAGE_MAINDETAILS()}->{'plot'}; # Should only have ->{'more'} remaining
1029  
1030 0 delete $d->{PAGE_USERCOMMENTS()}->{'limit'};
1031 0 delete $d->{PAGE_USERCOMMENTS()}->{'total'};
1032  
1033  
1034 # TODO: Check that there's nothing in these that doesn't occur in the dedicated pages
1035 0 delete $d->{PAGE_MAINDETAILS()}->{'news'};
1036 0 delete $d->{PAGE_MAINDETAILS()}->{'photos'};
1037 0 delete $d->{PAGE_MAINDETAILS()}->{'seasons'};
1038  
1039 0 delete $d->{PAGE_EXTERNAL_REVIEWS()}->{'tconst'};
1040 0 delete $d->{PAGE_EXTERNAL_REVIEWS()}->{'title'};
1041 0 delete $d->{PAGE_EXTERNAL_REVIEWS()}->{'type'};
1042 0 delete $d->{PAGE_EXTERNAL_REVIEWS()}->{'year'};
1043  
1044 0 delete $d->{PAGE_EPISODES()}->{'tconst'};
1045 0 delete $d->{PAGE_EPISODES()}->{'title'};
1046 0 delete $d->{PAGE_EPISODES()}->{'type'};
1047 0 delete $d->{PAGE_EPISODES()}->{'year'};
1048  
1049 0 delete $d->{PAGE_FULLCREDITS()}->{'tconst'};
1050 0 delete $d->{PAGE_FULLCREDITS()}->{'title'};
1051 0 delete $d->{PAGE_FULLCREDITS()}->{'type'};
1052 0 delete $d->{PAGE_FULLCREDITS()}->{'year'};
1053  
1054 0 delete $d->{PAGE_GOOFS()}->{'tconst'};
1055 0 delete $d->{PAGE_GOOFS()}->{'title'};
1056 0 delete $d->{PAGE_GOOFS()}->{'type'};
1057 0 delete $d->{PAGE_GOOFS()}->{'year'};
1058  
1059 0 delete $d->{PAGE_PHOTOS()}->{'tconst'};
1060 0 delete $d->{PAGE_PHOTOS()}->{'title'};
1061 0 delete $d->{PAGE_PHOTOS()}->{'type'};
1062 0 delete $d->{PAGE_PHOTOS()}->{'year'};
1063  
1064 0 delete $d->{PAGE_PLOT()}->{'tconst'};
1065 0 delete $d->{PAGE_PLOT()}->{'title'};
1066 0 delete $d->{PAGE_PLOT()}->{'type'};
1067 0 delete $d->{PAGE_PLOT()}->{'year'};
1068  
1069 0 delete $d->{PAGE_QUOTES()}->{'tconst'};
1070 0 delete $d->{PAGE_QUOTES()}->{'title'};
1071 0 delete $d->{PAGE_QUOTES()}->{'type'};
1072 0 delete $d->{PAGE_QUOTES()}->{'year'};
1073  
1074 0 delete $d->{PAGE_SYNOPSIS()}->{'tconst'};
1075 0 delete $d->{PAGE_SYNOPSIS()}->{'title'};
1076 0 delete $d->{PAGE_SYNOPSIS()}->{'type'};
1077 0 delete $d->{PAGE_SYNOPSIS()}->{'year'};
1078  
1079 0 delete $d->{PAGE_TRIVIA()}->{'tconst'};
1080 0 delete $d->{PAGE_TRIVIA()}->{'title'};
1081 0 delete $d->{PAGE_TRIVIA()}->{'type'};
1082 0 delete $d->{PAGE_TRIVIA()}->{'year'};
1083  
1084 0 delete $d->{PAGE_USERCOMMENTS()}->{'tconst'};
1085 0 delete $d->{PAGE_USERCOMMENTS()}->{'title'};
1086 0 delete $d->{PAGE_USERCOMMENTS()}->{'type'};
1087 0 delete $d->{PAGE_USERCOMMENTS()}->{'year'};
1088  
1089 0 return $d;
1090 }
1091  
1092 2 1;
« IMDB/UserComment.pm ↑ Summary IMDB/CreditList.pm »