about summary refs log tree commit homepage
path: root/lib/PublicInbox/OverIdx.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-10-22 07:45:38 +0000
committerEric Wong <e@80x24.org>2019-10-23 18:13:30 +0000
commitf9fc5cf2e8cefda4a56d937ed217e47689fd7e49 (patch)
tree669cde20959431be6cb54996c3b43ebe38cc7e23 /lib/PublicInbox/OverIdx.pm
parenta4b2bb62a0dde5054c5d2c0a7ea3fb3ff1806beb (diff)
parent1d6e0dbc3bad19acbfd90a9841a334dcaa0e4641 (diff)
downloadpublic-inbox-f9fc5cf2e8cefda4a56d937ed217e47689fd7e49.tar.gz
* regen:
  v2writable: use msgmap as multi_mid queue
  v2writable: move git->cleanup to the correct place
  v2writable: reindex handles 3-headered monsters
  v2writable: improve "num_for" API and disambiguate
  v2writable: set unindexed article number
Diffstat (limited to 'lib/PublicInbox/OverIdx.pm')
-rw-r--r--lib/PublicInbox/OverIdx.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/PublicInbox/OverIdx.pm b/lib/PublicInbox/OverIdx.pm
index e8df01c4..01ca6f11 100644
--- a/lib/PublicInbox/OverIdx.pm
+++ b/lib/PublicInbox/OverIdx.pm
@@ -337,6 +337,20 @@ sub remove_oid {
         $nr;
 }
 
+sub num_mid0_for_oid {
+        my ($self, $oid, $mid) = @_;
+        my ($num, $mid0);
+        $self->begin_lazy;
+        each_by_mid($self, $mid, ['ddd'], sub {
+                my ($smsg) = @_;
+                my $blob = $smsg->{blob};
+                return 1 if (!defined($blob) || $blob ne $oid); # continue;
+                ($num, $mid0) = ($smsg->{num}, $smsg->{mid});
+                0; # done
+        });
+        ($num, $mid0);
+}
+
 sub create_tables {
         my ($dbh) = @_;