line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package TMDB::Config; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
####################### |
4
|
|
|
|
|
|
|
# LOAD CORE MODULES |
5
|
|
|
|
|
|
|
####################### |
6
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
28
|
|
7
|
1
|
|
|
1
|
|
2
|
use warnings FATAL => 'all'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
78
|
|
8
|
1
|
|
|
1
|
|
6
|
use Carp qw(croak carp); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
62
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
####################### |
11
|
|
|
|
|
|
|
# LOAD CPAN MODULES |
12
|
|
|
|
|
|
|
####################### |
13
|
1
|
|
|
1
|
|
5
|
use Params::Validate qw(validate_with :types); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
126
|
|
14
|
1
|
|
|
|
|
5
|
use Object::Tiny qw( |
15
|
|
|
|
|
|
|
session |
16
|
|
|
|
|
|
|
config |
17
|
|
|
|
|
|
|
change_keys |
18
|
|
|
|
|
|
|
img_backdrop_sizes |
19
|
|
|
|
|
|
|
img_base_url |
20
|
|
|
|
|
|
|
img_secure_base_url |
21
|
|
|
|
|
|
|
img_poster_sizes |
22
|
|
|
|
|
|
|
img_profile_sizes |
23
|
|
|
|
|
|
|
img_logo_sizes |
24
|
|
|
|
|
|
|
img_default_size |
25
|
1
|
|
|
1
|
|
5
|
); |
|
1
|
|
|
|
|
2
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
####################### |
28
|
|
|
|
|
|
|
# LOAD DIST MODULES |
29
|
|
|
|
|
|
|
####################### |
30
|
1
|
|
|
1
|
|
285
|
use TMDB::Session; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
####################### |
33
|
|
|
|
|
|
|
# VERSION |
34
|
|
|
|
|
|
|
####################### |
35
|
|
|
|
|
|
|
our $VERSION = '1.2.1'; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
####################### |
38
|
|
|
|
|
|
|
# PUBLIC METHODS |
39
|
|
|
|
|
|
|
####################### |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
## ==================== |
42
|
|
|
|
|
|
|
## Constructor |
43
|
|
|
|
|
|
|
## ==================== |
44
|
|
|
|
|
|
|
sub new { |
45
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
46
|
0
|
|
|
|
|
|
my %opts = validate_with( |
47
|
|
|
|
|
|
|
params => \@_, |
48
|
|
|
|
|
|
|
spec => { |
49
|
|
|
|
|
|
|
session => { |
50
|
|
|
|
|
|
|
type => OBJECT, |
51
|
|
|
|
|
|
|
isa => 'TMDB::Session', |
52
|
|
|
|
|
|
|
}, |
53
|
|
|
|
|
|
|
img_default_size => { |
54
|
|
|
|
|
|
|
type => SCALAR, |
55
|
|
|
|
|
|
|
optional => 1, |
56
|
|
|
|
|
|
|
default => 'original', |
57
|
|
|
|
|
|
|
}, |
58
|
|
|
|
|
|
|
}, |
59
|
|
|
|
|
|
|
); |
60
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
my $self = $class->SUPER::new(%opts); |
62
|
|
|
|
|
|
|
|
63
|
0
|
|
0
|
|
|
|
my $config = $self->session->talk( { method => 'configuration' } ) || {}; |
64
|
0
|
|
|
|
|
|
$self->{config} = $config; |
65
|
0
|
|
0
|
|
|
|
$self->{img_backdrop_sizes} = $config->{images}->{backdrop_sizes} || []; |
66
|
0
|
|
0
|
|
|
|
$self->{img_poster_sizes} = $config->{images}->{poster_sizes} || []; |
67
|
0
|
|
0
|
|
|
|
$self->{img_profile_sizes} = $config->{images}->{profile_sizes} || []; |
68
|
0
|
|
0
|
|
|
|
$self->{img_logo_sizes} = $config->{images}->{logo_sizes} || []; |
69
|
0
|
|
0
|
|
|
|
$self->{img_base_url} = $config->{images}->{base_url} || q(); |
70
|
|
|
|
|
|
|
$self->{img_secure_base_url} |
71
|
0
|
|
0
|
|
|
|
= $config->{images}->{secure_base_url} || q(); |
72
|
0
|
|
0
|
|
|
|
$self->{change_keys} = $config->{change_keys} || []; |
73
|
|
|
|
|
|
|
|
74
|
0
|
|
|
|
|
|
return $self; |
75
|
|
|
|
|
|
|
} ## end sub new |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
####################### |
78
|
|
|
|
|
|
|
1; |