1 package WWW::EZTV::Episode;
5 # ABSTRACT: EZTV single episode
7 has show => is => 'ro', isa => 'WWW::EZTV::Show', required => 1;
8 has title => is => 'ro', isa => 'Str', required => 1;
9 has url => is => 'ro', isa => 'Mojo::URL', required => 1;
10 has links => is => 'rw';
12 has _parsed => is => 'ro', lazy => 1, builder => '_parse';
14 has name => is => 'ro', lazy => 1,
15 default => sub { shift->_parsed->{name} };
17 has season => is => 'ro', lazy => 1,
18 default => sub { shift->_parsed->{season} };
20 has number => is => 'ro', lazy => 1,
21 default => sub { shift->_parsed->{number} };
23 has version => is => 'ro', lazy => 1,
24 default => sub { shift->_parsed->{version} };
26 has quality => is => 'ro', lazy => 1,
27 default => sub { shift->_parsed->{quality} || 'standard' };
29 has size => is => 'ro', lazy => 1,
30 default => sub { shift->_parsed->{size} };
33 my $title = shift->title;
39 S (?<season>\d+) E (?<number>\d+)
40 |(?<season>\d+) x (?<number>\d+)
41 |(?<number>\d+) of (?<total>\d+)
45 ((?<quality>\d+p)\s+)?
58 name => $+{name} || $title,
59 chapter => $+{chapter},
60 number => $+{number} +0,
61 season => ($+{season}||0) +0,
62 total => ($+{total}||0) +0,
63 version => $+{version} || '',
64 quality => $+{quality} || 'standard',