forked from LBRYCommunity/lbry-sdk
merge conflicts
This commit is contained in:
parent
c00912015a
commit
1ec4111b9f
2 changed files with 5 additions and 8 deletions
|
@ -58,7 +58,7 @@ FIELDS = {
|
|||
|
||||
TEXT_FIELDS = {'author', 'canonical_url', 'channel_id', 'description', 'claim_id', 'censoring_channel_id',
|
||||
'media_type', 'normalized', 'public_key_bytes', 'public_key_id', 'short_url', 'signature',
|
||||
'name', 'signature_digest', 'stream_type', 'title', 'tx_id', 'fee_currency', 'reposted_claim_id',
|
||||
'name', 'signature_digest', 'title', 'tx_id', 'fee_currency', 'reposted_claim_id',
|
||||
'tags'}
|
||||
|
||||
RANGE_FIELDS = {
|
||||
|
@ -78,7 +78,7 @@ REPLACEMENTS = {
|
|||
'trending_mixed': 'trending_score',
|
||||
'normalized_name': 'normalized',
|
||||
'reposted': 'repost_count',
|
||||
# 'stream_types': 'stream_type',
|
||||
# 'media_types': 'media_type',
|
||||
'stream_types': 'stream_type',
|
||||
'media_types': 'media_type',
|
||||
'valid_channel_signature': 'is_signature_valid'
|
||||
}
|
||||
|
|
|
@ -9,7 +9,6 @@ from typing import Optional, List, Iterable, Union
|
|||
|
||||
from elasticsearch import AsyncElasticsearch, NotFoundError, ConnectionError
|
||||
from elasticsearch.helpers import async_streaming_bulk
|
||||
|
||||
from lbry.error import ResolveCensoredError, TooManyClaimSearchParametersError
|
||||
from lbry.schema.result import Outputs, Censor
|
||||
from lbry.schema.tags import clean_tags
|
||||
|
@ -503,8 +502,8 @@ def expand_query(**kwargs):
|
|||
value = CLAIM_TYPES[value]
|
||||
else:
|
||||
value = [CLAIM_TYPES[claim_type] for claim_type in value]
|
||||
# elif key == 'stream_type':
|
||||
# value = STREAM_TYPES[value] if isinstance(value, str) else list(map(STREAM_TYPES.get, value))
|
||||
elif key == 'stream_type':
|
||||
value = [STREAM_TYPES[value]] if isinstance(value, str) else list(map(STREAM_TYPES.get, value))
|
||||
if key == '_id':
|
||||
if isinstance(value, Iterable):
|
||||
value = [item[::-1].hex() for item in value]
|
||||
|
@ -512,8 +511,6 @@ def expand_query(**kwargs):
|
|||
value = value[::-1].hex()
|
||||
if not many and key in ('_id', 'claim_id') and len(value) < 20:
|
||||
partial_id = True
|
||||
if key == 'public_key_id':
|
||||
value = Base58.decode(value)[1:21].hex()
|
||||
if key in ('signature_valid', 'has_source'):
|
||||
continue # handled later
|
||||
if key in TEXT_FIELDS:
|
||||
|
|
Loading…
Reference in a new issue