forked from LBRYCommunity/lbry-sdk
unhexlify/hexlify some values in database/storage.py
This commit is contained in:
parent
971252d5d1
commit
1a3eaf7e6a
1 changed files with 3 additions and 4 deletions
|
@ -268,7 +268,7 @@ class SQLiteStorage(WalletDatabase):
|
|||
blob_hashes = yield self.run_and_return_list(
|
||||
"select blob_hash from blob where status='finished'"
|
||||
)
|
||||
defer.returnValue([bytes.fromhex(blob_hash).decode('latin-1') for blob_hash in blob_hashes])
|
||||
defer.returnValue([unhexlify(blob_hash) for blob_hash in blob_hashes])
|
||||
|
||||
def count_finished_blobs(self):
|
||||
return self.run_and_return_one_or_none(
|
||||
|
@ -492,10 +492,9 @@ class SQLiteStorage(WalletDatabase):
|
|||
@defer.inlineCallbacks
|
||||
def save_downloaded_file(self, stream_hash, file_name, download_directory, data_payment_rate):
|
||||
# touch the closest available file to the file name
|
||||
file_name = yield open_file_for_writing(bytes.fromhex(download_directory).decode(),
|
||||
bytes.fromhex(file_name).decode())
|
||||
file_name = yield open_file_for_writing(unhexlify(download_directory), unhexlify(file_name))
|
||||
result = yield self.save_published_file(
|
||||
stream_hash, file_name.encode('hex'), download_directory, data_payment_rate
|
||||
stream_hash, hexlify(file_name), download_directory, data_payment_rate
|
||||
)
|
||||
defer.returnValue(result)
|
||||
|
||||
|
|
Loading…
Reference in a new issue