line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: CreditList.pm 7370 2012-04-09 01:17:33Z chris $ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
WebService::IMDB::CreditList |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=cut |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package WebService::IMDB::CreditList; |
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
78
|
|
12
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
96
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = '0.05'; |
15
|
|
|
|
|
|
|
|
16
|
2
|
|
|
2
|
|
11
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
174
|
|
17
|
|
|
|
|
|
|
|
18
|
2
|
|
|
2
|
|
10
|
use Carp; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
152
|
|
19
|
|
|
|
|
|
|
our @CARP_NOT = qw(WebService::IMDB WebService::IMDB::Title); |
20
|
|
|
|
|
|
|
|
21
|
2
|
|
|
2
|
|
11
|
use WebService::IMDB::Credit; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
13
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw( |
24
|
|
|
|
|
|
|
label |
25
|
|
|
|
|
|
|
list |
26
|
|
|
|
|
|
|
token |
27
|
|
|
|
|
|
|
)); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 METHODS |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head2 label |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head2 list |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head2 token |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=cut |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub _new { |
41
|
0
|
|
|
0
|
|
|
my $class = shift; |
42
|
0
|
|
|
|
|
|
my $ws = shift; |
43
|
0
|
0
|
|
|
|
|
my $data = shift or die; |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
my $self = {}; |
46
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
bless $self, $class; |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
|
$self->label($data->{'label'}); |
50
|
0
|
0
|
0
|
|
|
|
if ($data->{'token'} eq "writers" && scalar @{$data->{'list'}} > 0 && exists $data->{'list'}->[0]->{'rewrite'}) { |
|
0
|
|
0
|
|
|
|
|
51
|
|
|
|
|
|
|
# TODO: How to parse this correctly? |
52
|
0
|
|
|
|
|
|
$self->list([]); |
53
|
|
|
|
|
|
|
} else { |
54
|
0
|
|
|
|
|
|
$self->list([ map { WebService::IMDB::Credit->_new($ws, $_) } @{$data->{'list'}}]); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
} |
56
|
0
|
|
|
|
|
|
$self->token($data->{'token'}); |
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
return $self; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |