Explorar o código

Strip [brackets] from chart titles

Christoph Berg %!s(int64=20) %!d(string=hai) anos
pai
achega
03d04097f5
Modificáronse 2 ficheiros con 2 adicións e 0 borrados
  1. 1 0
      docs/Changelog
  2. 1 0
      modules/Pisg/Parser/Logfile.pm

+ 1 - 0
docs/Changelog

@@ -7,6 +7,7 @@ pisg (0.68) - ??
      + More smileys (SF #1264834).
      + Suppress output when not writing to a terminal.
      + Print full path when config file comes from the search path.
+     + Strip [brackets] from chart titles.
    * Parsers:
      + Strip nick modes in xchat format (SF #1304262).
      + Add pointer to "compatibility" theme for XChat to FORMATS.

+ 1 - 0
modules/Pisg/Parser/Logfile.pm

@@ -662,6 +662,7 @@ sub _charts
     $Song =~ s/_/ /g;
     $Song =~ s/\d+ ?- ?//;
     $Song =~ s/\.(mp3|ogg|wma)//ig;
+    $Song =~ s/\[[^\] ]*\]/ /g; # strip stuff in brackets [44kbps]
     $Song =~ s/^ *[^\w]* *| *[^\w]* *$//g;
     my $song = lc $Song;
     $stats->{word_upcase}{$song} = $Song;