fix tests

This commit is contained in:
Jack Robison 2021-07-30 18:17:08 -04:00 committed by Victor Shyba
parent 371fc4d68c
commit 613acc7b00

View file

@ -594,17 +594,34 @@ class LevelDB:
) )
return return
if reposted_metadata: if reposted_metadata:
reposted_tags = [] if not reposted_metadata.is_stream else [tag for tag in reposted_metadata.stream.tags] if reposted_metadata.is_stream:
reposted_languages = [] if not reposted_metadata.is_stream else ( meta = reposted_metadata.stream
[lang.language or 'none' for lang in reposted_metadata.stream.languages] or ['none'] elif reposted_metadata.is_channel:
) meta = reposted_metadata.channel
elif reposted_metadata.is_collection:
meta = reposted_metadata.collection
elif reposted_metadata.is_repost:
meta = reposted_metadata.repost
else:
return
reposted_tags = [tag for tag in meta.tags]
reposted_languages = [lang.language or 'none' for lang in meta.languages] or ['none']
reposted_has_source = False if not reposted_metadata.is_stream else reposted_metadata.stream.has_source reposted_has_source = False if not reposted_metadata.is_stream else reposted_metadata.stream.has_source
reposted_claim_type = CLAIM_TYPES[reposted_metadata.claim_type] reposted_claim_type = CLAIM_TYPES[reposted_metadata.claim_type]
claim_tags = [] if not metadata.is_stream else [tag for tag in metadata.stream.tags] if metadata.is_stream:
claim_languages = [] if not metadata.is_stream else ( meta = metadata.stream
[lang.language or 'none' for lang in metadata.stream.languages] or ['none'] elif metadata.is_channel:
) meta = metadata.channel
elif metadata.is_collection:
meta = metadata.collection
elif metadata.is_repost:
meta = metadata.repost
else:
return
claim_tags = [tag for tag in meta.tags]
claim_languages = [lang.language or 'none' for lang in meta.languages] or ['none']
tags = list(set(claim_tags).union(set(reposted_tags))) tags = list(set(claim_tags).union(set(reposted_tags)))
languages = list(set(claim_languages).union(set(reposted_languages))) languages = list(set(claim_languages).union(set(reposted_languages)))