Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

channel name search on file list only works if the channel is resolved #3316

Open
tzarebczan opened this issue Jun 1, 2021 · 1 comment
Open
Labels
area: api area: files type: bug Existing functionality is wrong or broken

Comments

@tzarebczan
Copy link
Contributor

The file list won't return if you haven't resolved the channel.

We know that file * needs some love, and at some point we wanted to make the claim data inside the metadata to be consistent with resolve/claim search (can't find the issue for this, maybe was never filed or under a different name).

@tzarebczan tzarebczan added type: bug Existing functionality is wrong or broken area: files area: api labels Jun 1, 2021
@belikor
Copy link
Contributor

belikor commented Jun 26, 2021

If I understand what you mean by making the metadata consistent, I was also wondering about the type of information that is returned by different methods.

With resolve

import requests
server = "http://localhost:5279"  
uri = "samsodysee1:d"
msg = {"method": "resolve", 
       "params": {"urls": uri}}
output = requests.post(server, json=msg).json()
result = output["result"][uri]

print(result.keys())
dict_keys(['address', 'amount', 'canonical_url', 'claim_id', 'claim_op', 'confirmations', 'height', 'is_channel_signature_valid', 'meta', 'name', 'normalized_name', 'nout', 'permanent_url', 'short_url', 'signing_channel', 'timestamp', 'txid', 'type', 'value', 'value_type'])

With claim_search

name = "samsodysee1"
msg2 = {"method": "claim_search",
        "params": {"claim_name": name}}
output2 = requests.post(server, json=msg2).json()
result2 = output2["result"]["items"][0] 
result2 = result2["reposted_claim"]

print(result2.keys())
dict_keys(['address', 'amount', 'canonical_url', 'claim_id', 'claim_op', 'confirmations', 'height', 'is_channel_signature_valid', 'meta', 'name', 'normalized_name', 'nout', 'permanent_url', 'short_url', 'signing_channel', 'timestamp', 'txid', 'type', 'value', 'value_type'])

With file_list

name = "samsodysee1"
msg3 = {"method": "file_list", 
        "params": {"claim_name": name}}
output3 = requests.post(server, json=msg3).json()
result3 = output3["result"]["items"][0]

print(result3.keys())
dict_keys(['added_on', 'blobs_completed', 'blobs_in_stream', 'blobs_remaining', 'channel_claim_id', 'channel_name', 'claim_id', 'claim_name', 'completed', 'confirmations', 'content_fee', 'download_directory', 'download_path', 'file_name', 'height', 'is_fully_reflected', 'key', 'metadata', 'mime_type', 'nout', 'outpoint', 'points_paid', 'protobuf', 'purchase_receipt', 'reflector_progress', 'sd_hash', 'status', 'stopped', 'stream_hash', 'stream_name', 'streaming_url', 'suggested_file_name', 'timestamp', 'total_bytes', 'total_bytes_lower_bound', 'txid', 'uploading_to_reflector', 'written_bytes'])

The third method file_list returns much more data, but it also lacks some information, for example, it does not have 'canonical_url', and the 'channel_name' is just a string or None, while 'signing_channel' has more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: api area: files type: bug Existing functionality is wrong or broken
Projects
None yet
Development

No branches or pull requests

2 participants