also replace ampersands in artist
authorAndrew Lorimer <andrew@lorimer.id.au>
Thu, 6 Jun 2019 07:20:33 +0000 (17:20 +1000)
committerAndrew Lorimer <andrew@lorimer.id.au>
Thu, 6 Jun 2019 07:20:33 +0000 (17:20 +1000)
i3blocks-music.pl
index 2cebc3821f1bd8833030b67059e91afd75fd206c..4f71e2b271503b6f123a2b418b6c3a64bac7cb82 100755 (executable)
@@ -29,11 +29,11 @@ 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.+))+//;
 my $title = qx(playerctl $player_arg metadata title);
 $title =~ s/(\s|\s\()[Ff]([et]at[. ].*|t.*)//;
 $title =~ s/((\s(\(|\[).+(\)|\]).+)|(\s-\s.+))+//;
-$title =~ s/&/&amp;/;   # fix ampersand rendering for i3bar
 push(@metadata, $title) if $title;
 
 for (@metadata){
   s/\n//;   # remove newlines
 push(@metadata, $title) if $title;
 
 for (@metadata){
   s/\n//;   # remove newlines
+  s/&/&amp;/;   # fix ampersand rendering for i3bar
 }
 
 # Print stuff
 }
 
 # Print stuff