forked from LBRYCommunity/lbry-sdk
use ClaimDict.source_hash in utils.get_sd_hash
This commit is contained in:
parent
ee7ca0978f
commit
45b3837638
1 changed files with 3 additions and 0 deletions
|
@ -8,6 +8,7 @@ import json
|
||||||
|
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
|
|
||||||
|
from lbryschema.claim import ClaimDict
|
||||||
from lbrynet.core.cryptoutils import get_lbry_hash_obj
|
from lbrynet.core.cryptoutils import get_lbry_hash_obj
|
||||||
|
|
||||||
# digest_size is in bytes, and blob hashes are hex encoded
|
# digest_size is in bytes, and blob hashes are hex encoded
|
||||||
|
@ -112,6 +113,8 @@ def short_hash(hash_str):
|
||||||
def get_sd_hash(stream_info):
|
def get_sd_hash(stream_info):
|
||||||
if not stream_info:
|
if not stream_info:
|
||||||
return None
|
return None
|
||||||
|
if isinstance(stream_info, ClaimDict):
|
||||||
|
return stream_info.source_hash
|
||||||
return stream_info['stream']['source']['source']
|
return stream_info['stream']['source']['source']
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue