X-Git-Url: https://code.th-h.de/?p=usenet%2Fnewsstats.git;a=blobdiff_plain;f=gatherstats.pl;h=ae7d65dd890725cced757ce1c5178268b71f9779;hp=2bc426b93e12b82870cc3a01d7c68f8dcb324c7a;hb=36cffe7aedd7e7efa2bcffc6b993240c89f5b51a;hpb=93c8eae2edcb7ccb4a3fe25817908fdb0723f324 diff --git a/gatherstats.pl b/gatherstats.pl index 2bc426b..ae7d65d 100755 --- a/gatherstats.pl +++ b/gatherstats.pl @@ -132,7 +132,7 @@ foreach my $Month (&ListMonth($Period)) { # count postings per group my %Postings; while (($_) = $DBQuery->fetchrow_array) { - # get list oft newsgroups and hierarchies from Newsgroups: + # get list of newsgroups and hierarchies from Newsgroups: my %Newsgroups = ListNewsgroups($_,$TLH, $OptCheckgroupsFile ? \%ValidGroups : ''); # count each newsgroup and hierarchy once @@ -145,12 +145,19 @@ foreach my $Month (&ListMonth($Period)) { if (%ValidGroups) { foreach (sort keys %ValidGroups) { if (!defined($Postings{$_})) { - $Postings{$_} = 0 ; - warn (sprintf("ADDED: %s as empty group\n",$_)); + # expand newsgroup with hierarchies + my @Newsgroups = ParseHierarchies($_); + # add each empty newsgroup and empty hierarchies, too, as needed + foreach (@Newsgroups) { + if (!defined($Postings{$_})) { + $Postings{$_} = 0; + warn (sprintf("ADDED: %s as empty group\n",$_)); + }; + }; } }; }; - + # delete old data for that month if (!$OptTest) { $DBQuery = $DBHandle->do(sprintf("DELETE FROM %s.%s WHERE month = ?",