diff --git a/lbry/wallet/server/db/common.py b/lbry/wallet/server/db/common.py index 99655753b..a1cf53fa8 100644 --- a/lbry/wallet/server/db/common.py +++ b/lbry/wallet/server/db/common.py @@ -231,6 +231,7 @@ COMMON_TAGS = { } INDEXED_LANGUAGES = [ + 'none', 'en', 'aa', 'ab', diff --git a/lbry/wallet/server/db/writer.py b/lbry/wallet/server/db/writer.py index e83f9f7ac..9ca72e746 100644 --- a/lbry/wallet/server/db/writer.py +++ b/lbry/wallet/server/db/writer.py @@ -330,7 +330,7 @@ class SQLDB: #self.logger.exception(f"Could not decode claim name for {tx.id}:{txo.position}.") continue - language = None + language = 'none' try: if txo.claim.is_stream and txo.claim.stream.languages: language = txo.claim.stream.languages[0].language @@ -394,8 +394,7 @@ class SQLDB: elif claim.is_channel: claim_record['claim_type'] = CLAIM_TYPES['channel'] - if language: - languages[(language, claim_hash)] = (language, claim_hash, tx.height) + languages[(language, claim_hash)] = (language, claim_hash, tx.height) for tag in clean_tags(claim.message.tags): tags[(tag, claim_hash)] = (tag, claim_hash, tx.height) diff --git a/tests/integration/blockchain/test_claim_commands.py b/tests/integration/blockchain/test_claim_commands.py index 409264f93..a9c0591ec 100644 --- a/tests/integration/blockchain/test_claim_commands.py +++ b/tests/integration/blockchain/test_claim_commands.py @@ -271,6 +271,8 @@ class ClaimSearchCommand(ClaimTestCase): claim5 = await self.stream_create('claim5', fee_amount='1.0', fee_currency='usd', languages='es') await self.assertFindsClaims([claim4, claim3], any_languages=['en']) + await self.assertFindsClaims([claim2, claim1], any_languages=['none']) + await self.assertFindsClaims([claim4, claim3, claim2, claim1], any_languages=['none', 'en']) await self.assertFindsClaims([claim5], any_languages=['es']) await self.assertFindsClaims([claim5, claim4, claim3], any_languages=['en', 'es']) await self.assertFindsClaims([], fee_currency='foo')