compare only on rank, as voices may be subclassed

This commit is contained in:
Damien Elmes 2020-01-21 18:32:53 +10:00
parent 84711f8fe2
commit 5351a5f396
2 changed files with 3 additions and 2 deletions

View file

@ -14,6 +14,7 @@ from concurrent.futures import Future
from typing import Any, Callable, Dict, List, Optional, Tuple from typing import Any, Callable, Dict, List, Optional, Tuple
import pyaudio import pyaudio
from operator import itemgetter
import anki import anki
import aqt import aqt
@ -169,7 +170,7 @@ class AVPlayer:
if rank is not None: if rank is not None:
ranked.append((rank, p)) ranked.append((rank, p))
ranked.sort() ranked.sort(key=itemgetter(0))
if ranked: if ranked:
return ranked[-1][1] return ranked[-1][1]

View file

@ -9,7 +9,7 @@ or
{{tts ja_JP voices=Kyoko,Otoya,Another_name:Field}} {{tts ja_JP voices=Kyoko,Otoya,Another_name:Field}}
The first argument must be a language code. The first argument must be an underscored language code, eg en_US.
If provided, voices is a comma-separated list of one or more voices that If provided, voices is a comma-separated list of one or more voices that
the user would prefer. Spaces must not be included. Underscores will be the user would prefer. Spaces must not be included. Underscores will be