mirror of
https://github.com/LBRYFoundation/lbry-sdk.git
synced 2025-08-27 07:23:24 +00:00
Merge pull request #191 from lbryio/verify-published-file-exists
make publish fail when given an invalid file
This commit is contained in:
commit
bdeccb49b8
1 changed files with 5 additions and 0 deletions
|
@ -2010,11 +2010,16 @@ class Daemon(jsonrpc.JSONRPC):
|
||||||
metadata = Metadata(p['metadata'])
|
metadata = Metadata(p['metadata'])
|
||||||
make_lbry_file = False
|
make_lbry_file = False
|
||||||
sd_hash = metadata['sources']['lbry_sd_hash']
|
sd_hash = metadata['sources']['lbry_sd_hash']
|
||||||
|
log.info("Update publish for %s using existing stream", name)
|
||||||
except ValidationError:
|
except ValidationError:
|
||||||
make_lbry_file = True
|
make_lbry_file = True
|
||||||
sd_hash = None
|
sd_hash = None
|
||||||
metadata = p['metadata']
|
metadata = p['metadata']
|
||||||
file_path = p['file_path']
|
file_path = p['file_path']
|
||||||
|
if not file_path:
|
||||||
|
return defer.fail(Exception("No file given to publish"))
|
||||||
|
if not os.path.isfile(file_path):
|
||||||
|
return defer.fail(Exception("Specified file for publish doesnt exist: %s" % file_path))
|
||||||
|
|
||||||
if not self.pending_claim_checker.running:
|
if not self.pending_claim_checker.running:
|
||||||
self.pending_claim_checker.start(30)
|
self.pending_claim_checker.start(30)
|
||||||
|
|
Loading…
Add table
Reference in a new issue