File Coverage

blib/lib/Audio/File/Ogg/Tag.pm
Criterion Covered Total %
statement 23 23 100.0
branch 1 2 50.0
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 30 31 96.7


line stmt bran cond sub pod time code
1             package Audio::File::Ogg::Tag;
2              
3 1     1   6 use strict;
  1         2  
  1         73  
4 1     1   6 use warnings;
  1         2  
  1         29  
5 1     1   6 use base qw( Audio::File::Tag );
  1         2  
  1         81  
6 1     1   1345 use Ogg::Vorbis::Header::PurePerl;
  1         3502  
  1         222  
7              
8             our $VERSION = '0.02';
9              
10             sub init {
11 1     1 1 2 my $self = shift;
12 1 50       12 $self->{ogg} = Ogg::Vorbis::Header::PurePerl->new( $self->{filename} ) or return;
13              
14 1         6416 $self->title( $self->{ogg}->comment('title') );
15 1         6 $self->artist( $self->{ogg}->comment('artist') );
16 1         6 $self->album( $self->{ogg}->comment('album') );
17 1         4 $self->comment( $self->{ogg}->comment('comment') );
18 1         7 $self->genre( $self->{ogg}->comment('genre') );
19 1         5 $self->year( $self->{ogg}->comment('date') );
20 1         5 $self->track( $self->{ogg}->comment('tracknumber') );
21 1         5 $self->total( $self->{ogg}->comment('tracktotal') );
22              
23 1         5 return 1;
24             }
25              
26             1;