Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions plugins/listener2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ tokio-stream = { workspace = true }
tracing = { workspace = true }

aspasia = "0.2.1"

tauri-plugin-path2 = { path = "../path2" }
10 changes: 4 additions & 6 deletions plugins/listener2/src/commands.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use tauri::{Manager, path::BaseDirectory};
use tauri::Manager;
use tauri_plugin_path2::Path2PluginExt;

use crate::{BatchParams, Listener2PluginExt, Subtitle, VttWord};

Expand Down Expand Up @@ -34,11 +35,8 @@ pub async fn export_to_vtt<R: tauri::Runtime>(
) -> Result<String, String> {
use aspasia::{Moment, Subtitle, WebVttSubtitle, webvtt::WebVttCue};

let data_dir = app
.path()
.resolve("hyprnote/sessions", BaseDirectory::Data)
.map_err(|e| e.to_string())?;
let session_dir = data_dir.join(&session_id);
let base = app.path2().base().map_err(|e| e.to_string())?;
let session_dir = base.join("sessions").join(&session_id);

std::fs::create_dir_all(&session_dir).map_err(|e| e.to_string())?;

Expand Down
12 changes: 6 additions & 6 deletions plugins/settings/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ pub fn init<R: tauri::Runtime>() -> tauri::plugin::TauriPlugin<R> {

tauri::plugin::Builder::new(PLUGIN_NAME)
.invoke_handler(specta_builder.invoke_handler())
.setup(|app, _api| {
let base = app.path2().base().unwrap();
let state = SettingsState::new(base);
assert!(app.manage(state));
Ok(())
})
.setup(|app, _api| {
let base = app.path2().base().unwrap();
let state = SettingsState::new(base);
assert!(app.manage(state));
Ok(())
})
.build()
}

Expand Down