diff --git a/lbry/extras/daemon/json_response_encoder.py b/lbry/extras/daemon/json_response_encoder.py index bb4aefc41..cda561715 100644 --- a/lbry/extras/daemon/json_response_encoder.py +++ b/lbry/extras/daemon/json_response_encoder.py @@ -296,7 +296,7 @@ class JSONResponseEncoder(JSONEncoder): 'stream_name': None, 'suggested_file_name': None, 'sd_hash': None, - 'mime_type': None, + 'mime_type': managed_stream.mime_type, 'key': None, 'total_bytes_lower_bound': total_bytes_lower_bound, 'total_bytes': total_bytes, @@ -330,7 +330,6 @@ class JSONResponseEncoder(JSONEncoder): 'stream_name': managed_stream.stream_name, 'suggested_file_name': managed_stream.suggested_file_name, 'sd_hash': managed_stream.descriptor.sd_hash, - 'mime_type': managed_stream.mime_type, 'key': managed_stream.descriptor.key, 'blobs_completed': managed_stream.blobs_completed, 'blobs_in_stream': managed_stream.blobs_in_stream, diff --git a/tests/integration/datanetwork/test_file_commands.py b/tests/integration/datanetwork/test_file_commands.py index 32647f5d5..93d06f499 100644 --- a/tests/integration/datanetwork/test_file_commands.py +++ b/tests/integration/datanetwork/test_file_commands.py @@ -82,9 +82,10 @@ class FileCommands(CommandTestCase): # second call, see its there and move on self.assertNotIn('error', await self.out(self.daemon.jsonrpc_get('torrent'))) self.assertItemCount(await self.daemon.jsonrpc_file_list(), 1) - file = (await self.daemon.jsonrpc_file_list())['items'][0] - self.assertEqual(btih, file.identifier) - self.assertAlmostEqual(time.time(), file.added_on, delta=2) + file = (await self.out(self.daemon.jsonrpc_file_list()))['items'][0] + self.assertEqual(btih, file['metadata']['source']['bt_infohash']) + self.assertAlmostEqual(time.time(), file['added_on'], delta=2) + self.assertEqual("application/octet-stream", file['mime_type']) self.assertIn(btih, self.client_session._handles) # stream over streaming API (full range of the largest file)