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'])
|
||||
make_lbry_file = False
|
||||
sd_hash = metadata['sources']['lbry_sd_hash']
|
||||
log.info("Update publish for %s using existing stream", name)
|
||||
except ValidationError:
|
||||
make_lbry_file = True
|
||||
sd_hash = None
|
||||
metadata = p['metadata']
|
||||
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:
|
||||
self.pending_claim_checker.start(30)
|
||||
|
|
Loading…
Reference in a new issue