Commit d1883ba3 authored by Lukáš Lalinský's avatar Lukáš Lalinský

Fix error handling in decode_fingerprint

parent 45cfe389
Pipeline #20577 passed with stages
in 5 minutes and 29 seconds
......@@ -27,7 +27,10 @@ SELECT f.id, f.track_id, t.gid AS track_gid, score FROM (
def decode_fingerprint(fingerprint_string):
# type: (str) -> Optional[List[int]]
"""Decode a compressed and base64-encoded fingerprint"""
fingerprint, version = chromaprint.decode_fingerprint(fingerprint_string)
try:
fingerprint, version = chromaprint.decode_fingerprint(fingerprint_string)
except chromaprint.FingerprintError:
return None
if version != FINGERPRINT_VERSION:
return None
return fingerprint
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment