fix update
This commit is contained in:
parent
7439893a2a
commit
74660704e3
3 changed files with 18 additions and 3 deletions
|
@ -3495,6 +3495,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||||
|
|
||||||
if replace:
|
if replace:
|
||||||
claim = Claim()
|
claim = Claim()
|
||||||
|
if old_txo.claim.stream.has_source:
|
||||||
claim.stream.message.source.CopyFrom(
|
claim.stream.message.source.CopyFrom(
|
||||||
old_txo.claim.stream.message.source
|
old_txo.claim.stream.message.source
|
||||||
)
|
)
|
||||||
|
|
|
@ -303,6 +303,10 @@ class Stream(BaseClaim):
|
||||||
def has_fee(self) -> bool:
|
def has_fee(self) -> bool:
|
||||||
return self.message.HasField('fee')
|
return self.message.HasField('fee')
|
||||||
|
|
||||||
|
@property
|
||||||
|
def has_source(self) -> bool:
|
||||||
|
return self.message.HasField('source')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def source(self) -> Source:
|
def source(self) -> Source:
|
||||||
return Source(self.message.source)
|
return Source(self.message.source)
|
||||||
|
|
|
@ -1898,6 +1898,16 @@ class StreamCommands(ClaimTestCase):
|
||||||
self.assertEqual(claim['value']['tags'], ['anime'])
|
self.assertEqual(claim['value']['tags'], ['anime'])
|
||||||
self.assertNotIn('source', claim['value'])
|
self.assertNotIn('source', claim['value'])
|
||||||
|
|
||||||
|
# change metadata before the release
|
||||||
|
await self.publish(
|
||||||
|
'future-release', bid='0.1', tags=['Anime', 'anime ', 'psy-trance'], title='Psy will be over 9000!!!'
|
||||||
|
)
|
||||||
|
self.assertItemCount(await self.daemon.jsonrpc_file_list(), 2)
|
||||||
|
claim = await self.resolve('lbry://future-release')
|
||||||
|
self.assertEqual(claim['value']['tags'], ['anime', 'psy-trance'])
|
||||||
|
self.assertEqual(claim['value']['title'], 'Psy will be over 9000!!!')
|
||||||
|
self.assertNotIn('source', claim['value'])
|
||||||
|
|
||||||
# update the stream to have a source
|
# update the stream to have a source
|
||||||
with tempfile.NamedTemporaryFile() as file:
|
with tempfile.NamedTemporaryFile() as file:
|
||||||
file.write(b'hi')
|
file.write(b'hi')
|
||||||
|
|
Loading…
Reference in a new issue