diff --git a/lbrynet/extras/daemon/Daemon.py b/lbrynet/extras/daemon/Daemon.py index d4b7e67a7..1e89f62c7 100644 --- a/lbrynet/extras/daemon/Daemon.py +++ b/lbrynet/extras/daemon/Daemon.py @@ -2349,7 +2349,8 @@ class Daemon(metaclass=JSONRPCServerType): [--tags=...] [--clear_tags] [--languages=...] [--clear_languages] [--locations=...] [--clear_locations] - [--fee_currency=] [--fee_amount=] [--fee_address=] + [--fee_currency=] [--fee_amount=] + [--fee_address=] [--clear_fee] [--title=] [--description=<description>] [--author=<author>] [--language=<language>] [--license=<license>] [--license_url=<license_url>] [--thumbnail_url=<thumbnail_url>] [--release_time=<release_time>] [--width=<width>] [--height=<height>] [--duration=<duration>] @@ -2368,6 +2369,7 @@ class Daemon(metaclass=JSONRPCServerType): --fee_amount=<fee_amount> : (decimal) content download fee --fee_address=<fee_address> : (str) address where to send fee payments, will use value from --claim_address if not provided + --clear_fee : (bool) clear previously set fee --title=<title> : (str) title of the publication --description=<description> : (str) description of the publication --author=<author> : (str) author of the publication. The usage for this field is not diff --git a/lbrynet/schema/claim.py b/lbrynet/schema/claim.py index 9fe2ed40e..73b01b784 100644 --- a/lbrynet/schema/claim.py +++ b/lbrynet/schema/claim.py @@ -204,11 +204,14 @@ class Stream(BaseClaim): return claim def update(self, file_path=None, height=None, width=None, duration=None, **kwargs): - self.fee.update( - kwargs.pop('fee_address', None), - kwargs.pop('fee_currency', None), - kwargs.pop('fee_amount', None) - ) + if kwargs.pop('clear_fee', False): + self.message.ClearField('fee') + else: + self.fee.update( + kwargs.pop('fee_address', None), + kwargs.pop('fee_currency', None), + kwargs.pop('fee_amount', None) + ) if 'sd_hash' in kwargs: self.source.sd_hash = kwargs.pop('sd_hash') diff --git a/tests/integration/test_claim_commands.py b/tests/integration/test_claim_commands.py index 69f3ccb1d..d0ff9f3c3 100644 --- a/tests/integration/test_claim_commands.py +++ b/tests/integration/test_claim_commands.py @@ -346,7 +346,7 @@ class StreamCommands(CommandTestCase): fixed_values['locations'].insert(0, {'country': 'UA', 'city': 'Kyiv'}) # existing location self.assertEqual(stream, fixed_values) - # clearing and settings tags + # clearing and settings tags, languages and locations tx = await self.out(self.stream_update( claim_id, tags='single', clear_tags=True, languages='pt', clear_languages=True, @@ -358,6 +358,12 @@ class StreamCommands(CommandTestCase): fixed_values['locations'] = [{'country': 'BR'}] self.assertEqual(txo['value'], fixed_values) + # clearing fee + tx = await self.out(self.stream_update(claim_id, clear_fee=True)) + txo = tx['outputs'][0] + del fixed_values['fee'] + self.assertEqual(txo['value'], fixed_values) + # modifying hash/size/name fixed_values['source']['name'] = 'changed_name' fixed_values['source']['hash'] = 'cafebeef'