Merge pull request 'fix filename generation which didn't work and overwrote existing files' (#341) from ben_mkiv/ai-voice-cloning:master into master

Reviewed-on: #341
remotes/1712616735600285754/tmp_refs/heads/master
mrq 2023-08-24 12:29:59 +07:00
commit 4aa240d48a
1 changed files with 1 additions and 1 deletions

@ -1099,7 +1099,7 @@ def generate_tortoise(**kwargs):
for i, file in enumerate(os.listdir(outdir)):
filename = os.path.basename(file)
extension = os.path.splitext(filename)[-1][1:]
if extension != ".json" and extension != ".wav":
if extension != "json" and extension != "wav":
continue
match = re.findall(rf"^{voice}_(\d+)(?:.+?)?{extension}$", filename)
if match and len(match) > 0: