diff --git a/lbrynet/extras/daemon/Daemon.py b/lbrynet/extras/daemon/Daemon.py index 390ef004a..a8d82a48f 100644 --- a/lbrynet/extras/daemon/Daemon.py +++ b/lbrynet/extras/daemon/Daemon.py @@ -1809,7 +1809,7 @@ class Daemon(metaclass=JSONRPCServerType): """ if kwargs.pop('valid_channel_signatures', False): kwargs['is_channel_signature_valid'] = 1 - elif kwargs.pop('invalid_channel_signatures', False): + if kwargs.pop('invalid_channel_signatures', False): kwargs['is_channel_signature_valid'] = 0 page_num, page_size = abs(kwargs.pop('page', 1)), min(abs(kwargs.pop('page_size', 10)), 50) kwargs.update({'offset': page_size * (page_num-1), 'limit': page_size}) diff --git a/lbrynet/wallet/server/db.py b/lbrynet/wallet/server/db.py index a29bac425..7f35cba0b 100644 --- a/lbrynet/wallet/server/db.py +++ b/lbrynet/wallet/server/db.py @@ -752,11 +752,15 @@ class SQLDB: if 'claim_type' in constraints: constraints['claim.claim_type'] = CLAIM_TYPES[constraints.pop('claim_type')] if 'stream_types' in constraints: - constraints['claim.stream_type__in'] = [ - STREAM_TYPES[stream_type] for stream_type in constraints.pop('stream_types') - ] + stream_types = constraints.pop('stream_types') + if stream_types: + constraints['claim.stream_type__in'] = [ + STREAM_TYPES[stream_type] for stream_type in stream_types + ] if 'media_types' in constraints: - constraints['claim.media_type__in'] = constraints.pop('media_types') + media_types = constraints.pop('media_types') + if media_types: + constraints['claim.media_type__in'] = media_types _apply_constraints_for_array_attributes(constraints, 'tag') _apply_constraints_for_array_attributes(constraints, 'language') diff --git a/tests/integration/test_claim_commands.py b/tests/integration/test_claim_commands.py index ad401caa8..1b2f925dd 100644 --- a/tests/integration/test_claim_commands.py +++ b/tests/integration/test_claim_commands.py @@ -141,8 +141,9 @@ class ClaimSearchCommand(ClaimTestCase): await self.channel_abandon(claim_id=self.channel_id) await self.assertFindsClaims([], channel_ids=[self.channel_id], valid_channel_signatures=True) await self.assertFindsClaims([signed2], channel_ids=[channel_id2], valid_channel_signatures=True) + # pass `invalid_channel_signatures=False` to catch a bug in argument processing await self.assertFindsClaims([signed2], channel_ids=[channel_id2, self.channel_id], - valid_channel_signatures=True) + valid_channel_signatures=True, invalid_channel_signatures=False) # abandoned stream won't show up for streams in channel search await self.stream_abandon(txid=signed2['txid'], nout=0)