Merge pull request #107 from derxe/patch-2

Bug fix, duplicate audio filenames
This commit is contained in:
Alex Yatskov 2019-02-18 08:47:45 -08:00 committed by GitHub
commit ed4fec5549
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -713,11 +713,11 @@ class AnkiConnect:
skip = skipHash == m.hexdigest()
if not skip:
audioFilename = self.media().writeData(audio['filename'], data)
for field in audio['fields']:
if field in ankiNote:
ankiNote[field] += u'[sound:{}]'.format(audio['filename'])
self.media().writeData(audio['filename'], data)
ankiNote[field] += u'[sound:{}]'.format(audioFilename)
except Exception as e:
errorMessage = str(e).replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;")
for field in audio['fields']: