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 9, 2017
1 parent 8a45255 commit 153a7df
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions beetsplug/ipfs.py
Expand Up @@ -147,6 +147,7 @@ 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 153a7df

Please sign in to comment.