From 2c9422ef4a7e790ef6d119c1020ca1f8b38cb234 Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Sun, 10 May 2015 21:32:30 +1000 Subject: [PATCH] * cleanup --- lib/Text/Playlist/PLS.pm | 20 +------------------- lib/Text/Playlist/XSPF.pm | 19 +------------------ 2 files changed, 2 insertions(+), 37 deletions(-) diff --git a/lib/Text/Playlist/PLS.pm b/lib/Text/Playlist/PLS.pm index 5d5665b..a7bd925 100644 --- a/lib/Text/Playlist/PLS.pm +++ b/lib/Text/Playlist/PLS.pm @@ -10,25 +10,7 @@ our $VERSION = 0.1; sub new { my ($class) = @_; - return bless({ items => [] }, $class); -} - -sub add { - my ($self, %args) = @_; - - foreach my $key (qw(file title)) { - next if $args{$key}; - return "Missing '$key' parameter"; - } - - $self->{items} //= []; - push @{$self->{items}}, { - file => $args{file}, - title => $args{title}, - length => $args{length} || "-1", - }; - - return; + return bless({ }, $class); } sub parse { diff --git a/lib/Text/Playlist/XSPF.pm b/lib/Text/Playlist/XSPF.pm index 1bf3370..6a0d7ac 100644 --- a/lib/Text/Playlist/XSPF.pm +++ b/lib/Text/Playlist/XSPF.pm @@ -14,24 +14,7 @@ our $VERSION = 0.1; sub new { my ($class) = @_; - return bless({ items => [], version => 0 }, $class); -} - -sub add { - my ($self, %args) = @_; - - foreach my $key (qw(title location)) { - next if $args{$key}; - return "Missing '$key' parameter"; - } - - $self->{items} //= []; - push @{$self->{items}}, { - title => $args{title}, - location => $args{location}, - }; - - return; + return bless({ version => 0 }, $class); } sub parse {