refactor(profile): extract profile models and index rules

Move profile models and index rules into the crate, preserving serialization and returning a typed missing-profile error.
This commit is contained in:
Tunglies
2026-12-03 17:20:32 +08:00
parent 9614dee991
commit 64490c44ab
19 changed files with 1018 additions and 856 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ use tauri::Url;
use tristr::alias::String;
use crate::{
config::{Config, PrfItem, profiles},
config::{Config, PrfItem, fetch_remote_profile, profiles},
core::{CoreManager, handle, timer::Timer},
utils::help,
};
@@ -113,7 +113,7 @@ async fn import_subscription(url: &str, name: Option<&String>) {
}
async fn fetch_profile_item(url: &str, name: Option<&String>) -> Option<PrfItem> {
match PrfItem::from_url(url, name, None, None).await {
match fetch_remote_profile(url, name, None, None).await {
Ok(item) => Some(item),
Err(e) => {
logging!(error, Type::Config, "failed to parse profile from url: {:?}", e);