forked from LBRYCommunity/lbry-sdk
Merge pull request #1980 from lbryio/batched-channel-name-initialization
use _batched_select to populate channel names when initializing files
This commit is contained in:
commit
b266cde511
2 changed files with 6 additions and 5 deletions
|
@ -147,11 +147,11 @@ def get_all_lbry_files(transaction: sqlite3.Connection) -> typing.List[typing.Di
|
||||||
"claim": claim
|
"claim": claim
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
for claim_id in signed_claims.keys():
|
for claim_name, claim_id in _batched_select(
|
||||||
channel_name = transaction.execute("select claim_name from claim where claim_id=?", (claim_id, )).fetchone()
|
transaction, "select c.claim_name, c.claim_id from claim c where c.claim_id in {}",
|
||||||
if channel_name:
|
list(signed_claims.keys())):
|
||||||
for claim in signed_claims[claim_id]:
|
for claim in signed_claims[claim_id]:
|
||||||
claim.channel_name = channel_name[0]
|
claim.channel_name = claim_name
|
||||||
return files
|
return files
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -73,6 +73,7 @@ class TestAccount(AsyncioTestCase):
|
||||||
def test_load_and_save_account(self):
|
def test_load_and_save_account(self):
|
||||||
account_data = {
|
account_data = {
|
||||||
'name': 'Main Account',
|
'name': 'Main Account',
|
||||||
|
'modified_on': 123.456,
|
||||||
'seed':
|
'seed':
|
||||||
"carbon smart garage balance margin twelve chest sword toast envelope bottom stomac"
|
"carbon smart garage balance margin twelve chest sword toast envelope bottom stomac"
|
||||||
"h absent",
|
"h absent",
|
||||||
|
|
Loading…
Reference in a new issue