Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
618edf65ab | ||
|
|
c5b8eb06c6 | ||
|
|
4f44bdd037 | ||
|
|
32bfbd3791 |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "voice-to-notes",
|
"name": "voice-to-notes",
|
||||||
"version": "0.2.42",
|
"version": "0.2.44",
|
||||||
"description": "Desktop app for transcribing audio/video with speaker identification",
|
"description": "Desktop app for transcribing audio/video with speaker identification",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "voice-to-notes"
|
name = "voice-to-notes"
|
||||||
version = "0.2.42"
|
version = "0.2.44"
|
||||||
description = "Voice to Notes — desktop transcription with speaker identification"
|
description = "Voice to Notes — desktop transcription with speaker identification"
|
||||||
authors = ["Voice to Notes Contributors"]
|
authors = ["Voice to Notes Contributors"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|||||||
@@ -99,16 +99,6 @@ fn find_ffmpeg() -> Option<String> {
|
|||||||
};
|
};
|
||||||
let ffmpeg_path = sidecar_dir.join(ffmpeg_name);
|
let ffmpeg_path = sidecar_dir.join(ffmpeg_name);
|
||||||
if ffmpeg_path.exists() {
|
if ffmpeg_path.exists() {
|
||||||
// Ensure execute permission on Unix
|
|
||||||
#[cfg(unix)]
|
|
||||||
{
|
|
||||||
use std::os::unix::fs::PermissionsExt;
|
|
||||||
if let Ok(meta) = std::fs::metadata(&ffmpeg_path) {
|
|
||||||
let mut perms = meta.permissions();
|
|
||||||
perms.set_mode(0o755);
|
|
||||||
let _ = std::fs::set_permissions(&ffmpeg_path, perms);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Some(ffmpeg_path.to_string_lossy().to_string());
|
return Some(ffmpeg_path.to_string_lossy().to_string());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -197,15 +197,21 @@ pub async fn download_sidecar(app: AppHandle, variant: String) -> Result<(), Str
|
|||||||
let extract_dir = data_dir.join(format!("sidecar-{}", sidecar_version));
|
let extract_dir = data_dir.join(format!("sidecar-{}", sidecar_version));
|
||||||
SidecarManager::extract_zip(&zip_path, &extract_dir)?;
|
SidecarManager::extract_zip(&zip_path, &extract_dir)?;
|
||||||
|
|
||||||
// Make the binary executable on Unix
|
// Make all binaries executable on Unix (sidecar, ffmpeg, ffprobe, etc.)
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
{
|
{
|
||||||
use std::os::unix::fs::PermissionsExt;
|
use std::os::unix::fs::PermissionsExt;
|
||||||
let binary_path = extract_dir.join("voice-to-notes-sidecar");
|
if let Ok(entries) = std::fs::read_dir(&extract_dir) {
|
||||||
if let Ok(meta) = std::fs::metadata(&binary_path) {
|
for entry in entries.flatten() {
|
||||||
|
let path = entry.path();
|
||||||
|
if path.is_file() {
|
||||||
|
if let Ok(meta) = std::fs::metadata(&path) {
|
||||||
let mut perms = meta.permissions();
|
let mut perms = meta.permissions();
|
||||||
perms.set_mode(0o755);
|
perms.set_mode(0o755);
|
||||||
let _ = std::fs::set_permissions(&binary_path, perms);
|
let _ = std::fs::set_permissions(&path, perms);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -98,6 +98,9 @@ impl SidecarManager {
|
|||||||
|
|
||||||
// Already extracted — use it directly
|
// Already extracted — use it directly
|
||||||
if binary_path.exists() {
|
if binary_path.exists() {
|
||||||
|
// Ensure all binaries are executable (fixes previously extracted dirs)
|
||||||
|
#[cfg(unix)]
|
||||||
|
Self::set_executable_permissions(&extract_dir);
|
||||||
Self::cleanup_old_sidecars(data_dir, ¤t_version);
|
Self::cleanup_old_sidecars(data_dir, ¤t_version);
|
||||||
return Ok(binary_path);
|
return Ok(binary_path);
|
||||||
}
|
}
|
||||||
@@ -113,16 +116,8 @@ impl SidecarManager {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make executable on Unix
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
{
|
Self::set_executable_permissions(&extract_dir);
|
||||||
use std::os::unix::fs::PermissionsExt;
|
|
||||||
if let Ok(meta) = std::fs::metadata(&binary_path) {
|
|
||||||
let mut perms = meta.permissions();
|
|
||||||
perms.set_mode(0o755);
|
|
||||||
let _ = std::fs::set_permissions(&binary_path, perms);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Self::cleanup_old_sidecars(data_dir, ¤t_version);
|
Self::cleanup_old_sidecars(data_dir, ¤t_version);
|
||||||
Ok(binary_path)
|
Ok(binary_path)
|
||||||
@@ -207,6 +202,24 @@ impl SidecarManager {
|
|||||||
|
|
||||||
/// Remove old sidecar-* directories that don't match the current version.
|
/// Remove old sidecar-* directories that don't match the current version.
|
||||||
/// Called after the current version's sidecar is confirmed ready.
|
/// Called after the current version's sidecar is confirmed ready.
|
||||||
|
/// Set execute permissions on all files in a directory (Unix only).
|
||||||
|
#[cfg(unix)]
|
||||||
|
fn set_executable_permissions(dir: &Path) {
|
||||||
|
use std::os::unix::fs::PermissionsExt;
|
||||||
|
if let Ok(entries) = std::fs::read_dir(dir) {
|
||||||
|
for entry in entries.flatten() {
|
||||||
|
let path = entry.path();
|
||||||
|
if path.is_file() {
|
||||||
|
if let Ok(meta) = std::fs::metadata(&path) {
|
||||||
|
let mut perms = meta.permissions();
|
||||||
|
perms.set_mode(0o755);
|
||||||
|
let _ = std::fs::set_permissions(&path, perms);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub(crate) fn cleanup_old_sidecars(data_dir: &Path, current_version: &str) {
|
pub(crate) fn cleanup_old_sidecars(data_dir: &Path, current_version: &str) {
|
||||||
let current_dir_name = format!("sidecar-{}", current_version);
|
let current_dir_name = format!("sidecar-{}", current_version);
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schema.tauri.app/config/2",
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
"productName": "Voice to Notes",
|
"productName": "Voice to Notes",
|
||||||
"version": "0.2.42",
|
"version": "0.2.44",
|
||||||
"identifier": "com.voicetonotes.app",
|
"identifier": "com.voicetonotes.app",
|
||||||
"build": {
|
"build": {
|
||||||
"beforeDevCommand": "npm run dev",
|
"beforeDevCommand": "npm run dev",
|
||||||
|
|||||||
Reference in New Issue
Block a user