diff --git a/lbrynet/extras/daemon/json_response_encoder.py b/lbrynet/extras/daemon/json_response_encoder.py index 2089eaf2d..644991c98 100644 --- a/lbrynet/extras/daemon/json_response_encoder.py +++ b/lbrynet/extras/daemon/json_response_encoder.py @@ -193,7 +193,7 @@ class JSONResponseEncoder(JSONEncoder): def encode_claim_meta(self, meta): for key, value in meta.items(): - if key.endswith('_amount') or key.startswith('trending_'): + if key.endswith('_amount'): if isinstance(value, int): meta[key] = dewies_to_lbc(value) return meta diff --git a/lbrynet/schema/compat.py b/lbrynet/schema/compat.py index c2ec532c9..69402a745 100644 --- a/lbrynet/schema/compat.py +++ b/lbrynet/schema/compat.py @@ -15,8 +15,10 @@ def from_old_json_schema(claim, payload: bytes): raise DecodeError('Could not parse JSON.') stream = claim.stream stream.source.sd_hash = value['sources']['lbry_sd_hash'] - stream.source.media_type = value.get( - 'content_type', value.get('content-type', 'application/octet-stream')) + stream.source.media_type = ( + value.get('content_type', value.get('content-type')) or + 'application/octet-stream' + ) stream.title = value.get('title', '') stream.description = value.get('description', '') if value.get('thumbnail', ''): diff --git a/lbrynet/wallet/server/db.py b/lbrynet/wallet/server/db.py index 21b9070d4..41b3669ac 100644 --- a/lbrynet/wallet/server/db.py +++ b/lbrynet/wallet/server/db.py @@ -488,10 +488,9 @@ class SQLDB: postfix, value = ops[value[0]], int(value[1:]) constraints[f'claim.{constraint}{postfix}'] = value - if 'is_controlling' in constraints: + if constraints.pop('is_controlling', False): if {'sequence', 'amount_order'}.isdisjoint(constraints): constraints['claimtrie.claim_hash__is_not_null'] = '' - del constraints['is_controlling'] if 'sequence' in constraints: constraints['order_by'] = 'claim.activation_height ASC' constraints['offset'] = int(constraints.pop('sequence')) - 1