Преглед изворни кода

Do not include NULL tracks in charts

Torbjorn Svensson пре 20 година
родитељ
комит
ec2ea1ff15
2 измењених фајлова са 4 додато и 0 уклоњено
  1. 1 0
      docs/Changelog
  2. 3 0
      modules/Pisg/Parser/Logfile.pm

+ 1 - 0
docs/Changelog

@@ -34,6 +34,7 @@ pisg (0.69) - ??
      + Fix -cchannels option (SF #1369457).
      + Fix uninitialised values in charts (SF #1354920 and #1498999)
      + Fix Makefile to support the +CVS string and include it in releasename
+     + Fix charts to not include "NULL" tracks. 
    * Features:
      + Add "+CVS" to versionstring if ./CVS is found
    * Parsers:

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

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