]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
www: load cindex join data for ->ALL, too
authorEric Wong <e@80x24.org>
Tue, 28 Nov 2023 17:55:09 +0000 (17:55 +0000)
committerEric Wong <e@80x24.org>
Wed, 29 Nov 2023 02:13:27 +0000 (02:13 +0000)
This ensures the /all/ extindex can have auto-associations
with coderepos just like normal inboxes do.

lib/PublicInbox/CodeSearch.pm

index 7c0dd063a3c97fa54827ec9805a9e6be0d0a11e9..5c5774cfb0b3100a471fa236152b002613503ca4 100644 (file)
@@ -339,6 +339,15 @@ EOM
                my $s = $git->{ibx_score};
                @$s = sort { $b->[0] <=> $a->[0] } @$s if $s;
        }
+       my $ALL = $pi_cfg->ALL or return;
+       my @alls_gits = sort {
+               scalar @{$b->{ibx_score} // []} <=>
+                       scalar @{$a->{ibx_score} // []}
+       } values %$coderepos;
+       my $gits = $ALL->{-repo_objs} //= [];
+       push @$gits, @alls_gits;
+       my $cr_score = $ALL->{-cr_score} //= {};
+       $cr_score->{$_->{nick}} //= scalar(@{$_->{ibx_score}//[]}) for @$gits;
 }
 
 sub repos_sorted {