fix hyphen bug in music regex
[scripts.git] / i3blocks-music.pl
index 2cebc3821f1bd8833030b67059e91afd75fd206c..97deed4df26bd1da26d436955dd5f1cffc3410d2 100755 (executable)
@@ -28,12 +28,12 @@ push(@metadata, $artist) if $artist;
 
 my $title = qx(playerctl $player_arg metadata title);
 $title =~ s/(\s|\s\()[Ff]([et]at[. ].*|t.*)//;
-$title =~ s/((\s(\(|\[).+(\)|\]).+)|(\s-\s.+))+//;
-$title =~ s/&/&/;   # fix ampersand rendering for i3bar
+$title =~ s/((\s(\(|\[).+(\)|\]).*)|(\s-\s.+))//;
 push(@metadata, $title) if $title;
 
 for (@metadata){
   s/\n//;   # remove newlines
+  s/&/&/;   # fix ampersand rendering for i3bar
 }
 
 # Print stuff