Skip to content

Commit

Permalink
IPFS plugin: Add note to check hashes carefully
Browse files Browse the repository at this point in the history
In the future, just checking that a hash begins with "Qm" and has length
46 will likely not be sufficient.
  • Loading branch information
musoke committed May 11, 2017
1 parent ca8c557 commit c531927
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions beetsplug/ipfs.py
Expand Up @@ -147,6 +147,8 @@ def ipfs_add(self, album):
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:
Expand Down

0 comments on commit c531927

Please sign in to comment.