forked from LBRYCommunity/lbry-sdk
Merge pull request #2925 from lbryio/fix-reposts-tag
fix: reposts being returned for single tags
This commit is contained in:
commit
7e23d6e2ef
1 changed files with 5 additions and 5 deletions
|
@ -547,10 +547,10 @@ def _apply_constraints_for_array_attributes(constraints, attr, cleaner, for_coun
|
||||||
if for_count or attr == 'tag':
|
if for_count or attr == 'tag':
|
||||||
if attr == 'tag':
|
if attr == 'tag':
|
||||||
any_queries[f'#_any_{attr}'] = f"""
|
any_queries[f'#_any_{attr}'] = f"""
|
||||||
(claim.claim_type != {CLAIM_TYPES['repost']}
|
((claim.claim_type != {CLAIM_TYPES['repost']}
|
||||||
AND claim.claim_hash IN (SELECT claim_hash FROM tag WHERE tag IN ({values}))) OR
|
AND claim.claim_hash IN (SELECT claim_hash FROM tag WHERE tag IN ({values}))) OR
|
||||||
(claim.claim_type == {CLAIM_TYPES['repost']} AND
|
(claim.claim_type == {CLAIM_TYPES['repost']} AND
|
||||||
claim.reposted_claim_hash IN (SELECT claim_hash FROM tag WHERE tag IN ({values})))
|
claim.reposted_claim_hash IN (SELECT claim_hash FROM tag WHERE tag IN ({values}))))
|
||||||
"""
|
"""
|
||||||
else:
|
else:
|
||||||
any_queries[f'#_any_{attr}'] = f"""
|
any_queries[f'#_any_{attr}'] = f"""
|
||||||
|
@ -606,10 +606,10 @@ def _apply_constraints_for_array_attributes(constraints, attr, cleaner, for_coun
|
||||||
if for_count:
|
if for_count:
|
||||||
if attr == 'tag':
|
if attr == 'tag':
|
||||||
constraints[f'#_not_{attr}'] = f"""
|
constraints[f'#_not_{attr}'] = f"""
|
||||||
(claim.claim_type != {CLAIM_TYPES['repost']}
|
((claim.claim_type != {CLAIM_TYPES['repost']}
|
||||||
AND claim.claim_hash NOT IN (SELECT claim_hash FROM tag WHERE tag IN ({values}))) AND
|
AND claim.claim_hash NOT IN (SELECT claim_hash FROM tag WHERE tag IN ({values}))) OR
|
||||||
(claim.claim_type == {CLAIM_TYPES['repost']} AND
|
(claim.claim_type == {CLAIM_TYPES['repost']} AND
|
||||||
claim.reposted_claim_hash NOT IN (SELECT claim_hash FROM tag WHERE tag IN ({values})))
|
claim.reposted_claim_hash NOT IN (SELECT claim_hash FROM tag WHERE tag IN ({values}))))
|
||||||
"""
|
"""
|
||||||
else:
|
else:
|
||||||
constraints[f'#_not_{attr}'] = f"""
|
constraints[f'#_not_{attr}'] = f"""
|
||||||
|
|
Loading…
Reference in a new issue