Improve plugin source modeling and runtime dedup (#414)

This commit is contained in:
Gregory Schier
2026-03-01 16:30:43 -08:00
committed by GitHub
parent 2d99e26f19
commit 2ca51125a4
13 changed files with 210 additions and 44 deletions

View File

@@ -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) => {