fixing more issues with audio

This commit is contained in:
Alex Yatskov 2018-06-23 09:53:28 -07:00
parent 7d39517280
commit f109f89d2f

View File

@ -649,12 +649,13 @@ class AnkiConnect:
if audio is not None and len(audio['fields']) > 0: if audio is not None and len(audio['fields']) > 0:
try: try:
data = self.download(audio['url']) data = self.download(audio['url'])
if audio['skipHash'] is None: skipHash = audio.get('skipHash')
if skipHash is None:
skip = False skip = False
else: else:
m = hashlib.md5() m = hashlib.md5()
m.update(data) m.update(data)
skip = audio['skipHash'] == m.hexdigest() skip = skipHash == m.hexdigest()
if not skip: if not skip:
for field in audio['fields']: for field in audio['fields']: