line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package TV::Anytime::Service; |
2
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
40
|
|
3
|
1
|
|
|
1
|
|
8
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
29
|
|
4
|
1
|
|
|
1
|
|
6
|
use base 'Class::Accessor::Chained::Fast'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
421
|
|
5
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw( |
6
|
|
|
|
|
|
|
anytime |
7
|
|
|
|
|
|
|
genres_ref |
8
|
|
|
|
|
|
|
id |
9
|
|
|
|
|
|
|
logo |
10
|
|
|
|
|
|
|
name |
11
|
|
|
|
|
|
|
owner |
12
|
|
|
|
|
|
|
)); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub events { |
15
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
16
|
0
|
|
|
|
|
|
my($programs, $events) = $self->anytime->_programs($self->id); |
17
|
0
|
|
|
|
|
|
return @$events; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub genres { |
21
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
22
|
0
|
|
|
|
|
|
return @{$self->genres_ref}; |
|
0
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub is_television { |
26
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
27
|
0
|
|
|
|
|
|
foreach my $genre ($self->genres) { |
28
|
0
|
0
|
|
|
|
|
if ($genre->name eq 'MediaType') { |
29
|
0
|
|
|
|
|
|
return $genre->value eq 'Audio and video'; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
0
|
|
|
|
|
|
return 0; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub is_radio { |
36
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
37
|
0
|
|
|
|
|
|
foreach my $genre ($self->genres) { |
38
|
0
|
0
|
|
|
|
|
if ($genre->name eq 'MediaType') { |
39
|
0
|
|
|
|
|
|
return $genre->value eq 'Audio only'; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
} |
42
|
0
|
|
|
|
|
|
return 0; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub programs { |
46
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
47
|
0
|
|
|
|
|
|
my($programs, $events) = $self->anytime->_programs($self->id); |
48
|
0
|
|
|
|
|
|
return @$programs; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
__END__ |