Skip to content

Commit

Permalink
fix(ttsabstract): refactor save method to use timestamp instead of ra…
Browse files Browse the repository at this point in the history
…ndomUUID (#10)
  • Loading branch information
yousefhany77 committed Mar 21, 2024
2 parents 6945634 + 41e51d2 commit 597899f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/core/Abstract/TtsAbstract.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { randomUUID } from 'crypto';
import { existsSync, promises as fs, mkdirSync } from 'fs';
import { dirname } from 'path';
import * as z from 'zod';
Expand Down Expand Up @@ -84,7 +83,7 @@ export abstract class TtsAbstract<P extends ProviderKeys> {
@FlattenZodError
public async save(filePath?: string): Promise<string> {
if (!filePath) {
filePath = `${this.audioDir}/${randomUUID()}.mp3`;
filePath = `${this.audioDir}/${Date.now()}.mp3`;
}

const path = await z
Expand Down

0 comments on commit 597899f

Please sign in to comment.