mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-29 22:01:47 +02:00
Improve plugin source modeling and runtime dedup (#414)
This commit is contained in:
@@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize};
|
||||
use std::path::Path;
|
||||
use std::str::FromStr;
|
||||
use ts_rs::TS;
|
||||
use yaak_models::models::Plugin;
|
||||
use yaak_models::models::{Plugin, PluginSource};
|
||||
|
||||
/// Get plugin info from the registry.
|
||||
pub async fn get_plugin(
|
||||
@@ -58,7 +58,7 @@ pub async fn check_plugin_updates(
|
||||
) -> Result<PluginUpdatesResponse> {
|
||||
let name_versions: Vec<PluginNameVersion> = plugins
|
||||
.into_iter()
|
||||
.filter(|p| p.url.is_some()) // Only check plugins with URLs (from registry)
|
||||
.filter(|p| matches!(p.source, PluginSource::Registry)) // Only check registry-installed plugins
|
||||
.filter_map(|p| match get_plugin_meta(&Path::new(&p.directory)) {
|
||||
Ok(m) => Some(PluginNameVersion { name: m.name, version: m.version }),
|
||||
Err(e) => {
|
||||
|
||||
Reference in New Issue
Block a user