mirror of https://github.com/perkeep/perkeep.git
pkg/index: fix corpus AppendClaims use of signerFilter
Follow-up of ec66bcc871
This change should be the last of its kind, in the corpus at least, and
should make most searches and the web UI usable again, with both kinds
of hashes (sha1 and sha224).
Updates #537
Change-Id: Icfe9e8aaab031313612c555b7601895aeba16a7c
This commit is contained in:
parent
c03ad46ce9
commit
c1d6bd06b0
|
@ -1297,13 +1297,28 @@ func (c *Corpus) AppendClaims(ctx context.Context, dst []camtypes.Claim, permaNo
|
|||
if !ok {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
var signerRefs signerRefSet
|
||||
if signerFilter.Valid() {
|
||||
signer, ok := c.keyId[signerFilter]
|
||||
if !ok {
|
||||
return dst, nil
|
||||
}
|
||||
signerRefs, ok = c.signerRefs[signer]
|
||||
if !ok {
|
||||
return dst, nil
|
||||
}
|
||||
}
|
||||
|
||||
for _, cl := range pm.Claims {
|
||||
if c.IsDeleted(cl.BlobRef) {
|
||||
continue
|
||||
}
|
||||
if signerFilter.Valid() && cl.Signer != signerFilter {
|
||||
|
||||
if len(signerRefs) > 0 && !signerRefs.blobMatches(cl.Signer) {
|
||||
continue
|
||||
}
|
||||
|
||||
if attrFilter != "" && cl.Attr != attrFilter {
|
||||
continue
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue