Browse Source

* skip leading spaces before title in m3u playlist

master 0.02
Alex 'AdUser' Z 10 years ago
parent
commit
bed3dea90f
  1. 2
      lib/Text/Playlist/M3U.pm
  2. 1
      t/m3u.t

2
lib/Text/Playlist/M3U.pm

@ -32,7 +32,7 @@ sub parse {
$self->{attrs} = $self->_parse_attrs($1);
}
# standart tags
if ($line =~ m/^\s*#EXTINF:(-?\d+(?:\.\d+)?)(\s+\S+?=\S+)*,(.*)/oi) {
if ($line =~ m/^\s*#EXTINF:(-?\d+(?:\.\d+)?)(\s+\S+?=\S+)*,\s*(.*)/oi) {
$item //= {
duration => $1,
attrs => $self->_parse_attrs($2),

1
t/m3u.t

@ -40,6 +40,7 @@ my @items = $pls->load($path);
is_deeply(\@items, $out, "Loading test playlist");
unlink $path;
$text =~ s/,\s+Second/,Second/o;
is($text, $pls->dump(@items));
exit 0;

Loading…
Cancel
Save