forked from LBRYCommunity/lbry-sdk
only repeat search if it has blocked items
This commit is contained in:
parent
1e5331768f
commit
e61874bb6f
1 changed files with 5 additions and 6 deletions
|
@ -155,13 +155,12 @@ class SearchIndex:
|
|||
total_referenced, response, censor = await self.resolve(*kwargs)
|
||||
else:
|
||||
censor = Censor(Censor.SEARCH)
|
||||
response, offset, total = await self.search(**kwargs, censor_type=0)
|
||||
response, offset, total = await self.search(**kwargs)
|
||||
censor.apply(response)
|
||||
total_referenced.extend(response)
|
||||
kwargs['limit'] = 20
|
||||
kwargs['offset'] = 0
|
||||
censored_response, _, _ = await self.search(**kwargs, censor_type='>0')
|
||||
censor.apply(censored_response)
|
||||
total_referenced.extend(censored_response)
|
||||
if censor.censored:
|
||||
response, _, _ = await self.search(**kwargs, censor_type=0)
|
||||
total_referenced.extend(response)
|
||||
return Outputs.to_base64(response, await self._get_referenced_rows(total_referenced), offset, total, censor)
|
||||
|
||||
async def resolve(self, *urls):
|
||||
|
|
Loading…
Reference in a new issue