Skip to content

Commit

Permalink
Misc changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ovenoboyo committed Sep 2, 2024
1 parent fbac0a4 commit 8dde2a1
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ jobs:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
with:
tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
releaseName: "App v__VERSION__"
tagName: moosync-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
releaseName: "Moosync v__VERSION__"
releaseBody: "See the assets to download this version and install."
releaseDraft: true
prerelease: true
Expand Down
1 change: 1 addition & 0 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ tauri = { version = "2.0.0-beta.24", features = [
"wry",
"protocol-asset",
"tray-icon",
"devtools",
], default-features = false }
tauri-plugin-deep-link = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
tauri-plugin-dialog = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
Expand Down
29 changes: 14 additions & 15 deletions src-tauri/extensions/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ macro_rules! helper1 {
channel: Uuid::new_v4().to_string(),
data: $data,
};
$self.broadcast(serde_json::to_value(value).unwrap()).await
$self.broadcast(serde_json::to_value(value)?).await
}
};

Expand All @@ -66,14 +66,13 @@ macro_rules! helper1 {

let parsed = serde_json::from_value::<HashMap<String, Value>>(first.clone());
if let Ok(parsed) = parsed {
println!("Parsed: {:?}", parsed);
if package_name.is_empty() {
return Ok(Default::default());
}

let first_result = parsed.get(&package_name);
if let Some(first_result) = first_result {
let parsed = serde_json::from_value(first_result.clone()).unwrap();
let parsed = serde_json::from_value(first_result.clone())?;
return Ok(parsed);
} else {
tracing::info!("Extension did not reply");
Expand Down Expand Up @@ -204,18 +203,18 @@ impl ExtensionHandler {
});
});

let exe_path = env::current_exe().unwrap();
let _handle = Command::new(exe_path.clone().parent().unwrap().join("exthost"))
.args([
"-ipcPath",
self.ipc_path.to_str().unwrap(),
"-extensionPath",
self.extensions_dir.to_str().unwrap(),
"-installPath",
exe_path.to_str().unwrap(),
])
.spawn()
.unwrap();
// let exe_path = env::current_exe().unwrap();
// let _handle = Command::new(exe_path.clone().parent().unwrap().join("exthost"))
// .args([
// "-ipcPath",
// self.ipc_path.to_str().unwrap(),
// "-extensionPath",
// self.extensions_dir.to_str().unwrap(),
// "-installPath",
// exe_path.to_str().unwrap(),
// ])
// .spawn()
// .unwrap();

Ok(rx_listen)
}
Expand Down
4 changes: 2 additions & 2 deletions src-tauri/macros/src/command_macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ macro_rules! generate_command_cached {
#[tracing::instrument(level = "trace", skip(db, cache))]
#[tauri::command(async)]
pub async fn $method_name(db: State<'_, $state>, cache: State<'_, CacheHolder>, $($v: $t),*) -> types::errors::Result<$ret> {
tracing::info!("calling cached {}", stringify!($method_name));
let mut cache_string = String::new();
cache_string.push_str(stringify!($method_name));
$(
Expand All @@ -32,6 +31,7 @@ macro_rules! generate_command_cached {
}
)*

tracing::info!("calling cached {}: {}", stringify!($method_name), cache_string);
let cached = cache.get(cache_string.as_str());
if cached.is_ok() {
return cached;
Expand Down Expand Up @@ -83,7 +83,6 @@ macro_rules! generate_command_async_cached {
#[tracing::instrument(level = "trace", skip(db, cache))]
#[tauri::command(async)]
pub async fn $method_name(db: State<'_, $state>, cache: State<'_, CacheHolder>, $($v: $t),*) -> types::errors::Result<$ret> {
tracing::info!("calling cached async {}", stringify!($method_name));
let mut cache_string = String::new();
cache_string.push_str(stringify!($method_name));
$(
Expand All @@ -92,6 +91,7 @@ macro_rules! generate_command_async_cached {
}
)*

tracing::info!("calling cached async {}: {}", stringify!($method_name), cache_string);
let cached = cache.get(cache_string.as_str());

if cached.is_ok() {
Expand Down
6 changes: 5 additions & 1 deletion src-tauri/src/providers/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,11 @@ impl GenericProvider for ExtensionProvider {
SongReturnType
);

Ok(res.song)
if let Some(song) = res.song {
return Ok(song);
}

Err("Song not found".into())
}

#[tracing::instrument(level = "trace", skip(self))]
Expand Down
6 changes: 5 additions & 1 deletion src-tauri/src/providers/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,11 @@ impl ProviderHandler {
let provides = ext_handler
.get_provider_scopes(extension.package_name.clone().into())
.await;
tracing::info!("Got provider scopes from {}", extension.package_name);
tracing::info!(
"Got provider scopes from {} {:?}",
extension.package_name,
provides
);
if let Ok(provides) = provides {
if provides.is_empty() {
continue;
Expand Down

0 comments on commit 8dde2a1

Please sign in to comment.