Skip to content

Commit

Permalink
react ui: fix missing directory errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rsxdalv committed Jan 14, 2024
1 parent d82b905 commit 06ab788
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ https://rsxdalv.github.io/bark-speaker-directory/
https://github.com/rsxdalv/tts-generation-webui/discussions/186#discussioncomment-7291274

## Changelog
Jan 14:
* React UI: Fix missing directory errors

Jan 13:
* React UI: Fix missing npm build step from automatic install

Expand Down
6 changes: 5 additions & 1 deletion react-ui/src/data/getVoicesData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ export const getNpzDataSimpleVoices = async () =>

export const getDataFromJSON = async (collection = "outputs") => {
const basePath = getWebuiPath(collection);
const dirs = fs.readdirSync(basePath);
const dirs = await fs.promises.readdir(basePath).catch((error) => {
console.error(error);
return [];
});

const oggData = dirs.map(async (dirname) => {
const coreFilename = path.join(dirname, dirname + ".ogg");
const jsonFilename = path.join(basePath, dirname, dirname + ".json");
Expand Down

0 comments on commit 06ab788

Please sign in to comment.