Merge pull request #107 from derxe/patch-2
Bug fix, duplicate audio filenames
This commit is contained in:
commit
ed4fec5549
@ -713,11 +713,11 @@ class AnkiConnect:
|
|||||||
skip = skipHash == m.hexdigest()
|
skip = skipHash == m.hexdigest()
|
||||||
|
|
||||||
if not skip:
|
if not skip:
|
||||||
|
audioFilename = self.media().writeData(audio['filename'], data)
|
||||||
for field in audio['fields']:
|
for field in audio['fields']:
|
||||||
if field in ankiNote:
|
if field in ankiNote:
|
||||||
ankiNote[field] += u'[sound:{}]'.format(audio['filename'])
|
ankiNote[field] += u'[sound:{}]'.format(audioFilename)
|
||||||
|
|
||||||
self.media().writeData(audio['filename'], data)
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
errorMessage = str(e).replace("&", "&").replace("<", "<").replace(">", ">")
|
errorMessage = str(e).replace("&", "&").replace("<", "<").replace(">", ">")
|
||||||
for field in audio['fields']:
|
for field in audio['fields']:
|
||||||
|
Loading…
Reference in New Issue
Block a user