IPFS plugin: Add note to check hashes carefully

In the future, just checking that a hash begins with "Qm" and has length
46 will likely not be sufficient.
This commit is contained in:
Nathan Musoke 2017-05-09 15:38:50 +12:00
parent ca8c557840
commit c5319274ca

View file

@ -147,6 +147,8 @@ class IPFSPlugin(BeetsPlugin):
def ipfs_get(self, lib, query):
query = query[0]
# Check if query is a hash
# TODO: generalize to other hashes; probably use a multihash
# implementation
if query.startswith("Qm") and len(query) == 46:
self.ipfs_get_from_hash(lib, query)
else: