mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-10-03 09:05:17 -07:00
Merge pull request #40 from Spyabo/fix/audio-export-path-resolution
Fix: audio export path resolution
This commit is contained in:
@@ -53,6 +53,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Audio export failing when Tauri save dialog returns object instead of string path
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- **Makefile** - Comprehensive development workflow automation with commands for setup, development, building, testing, and code quality checks
|
- **Makefile** - Comprehensive development workflow automation with commands for setup, development, building, testing, and code quality checks
|
||||||
- Includes Python version detection and compatibility warnings
|
- Includes Python version detection and compatibility warnings
|
||||||
|
|||||||
@@ -10,9 +10,20 @@ export const tauriFilesystem: PlatformFilesystem = {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (filePath) {
|
if (filePath) {
|
||||||
const { writeBinaryFile } = await import('@tauri-apps/plugin-fs');
|
let resolvedPath = '';
|
||||||
|
if (typeof filePath === 'string') {
|
||||||
|
resolvedPath = filePath;
|
||||||
|
} else if (filePath && typeof filePath === 'object' && 'path' in filePath) {
|
||||||
|
resolvedPath = (filePath as { path: string }).path;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!resolvedPath) {
|
||||||
|
throw new Error('Failed to resolve save path');
|
||||||
|
}
|
||||||
|
|
||||||
|
const { writeFile } = await import('@tauri-apps/plugin-fs');
|
||||||
const arrayBuffer = await blob.arrayBuffer();
|
const arrayBuffer = await blob.arrayBuffer();
|
||||||
await writeBinaryFile(filePath, new Uint8Array(arrayBuffer));
|
await writeFile(resolvedPath, new Uint8Array(arrayBuffer));
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to use Tauri dialog, falling back to browser download:', error);
|
console.error('Failed to use Tauri dialog, falling back to browser download:', error);
|
||||||
|
|||||||
Reference in New Issue
Block a user