forked from akanyan/STARTLINER
feat: misc improvements
This commit is contained in:
@ -3,7 +3,7 @@ use ongeki::OngekiProfile;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tauri::AppHandle;
|
||||
use std::{collections::BTreeSet, path::{Path, PathBuf}};
|
||||
use crate::{model::misc::Game, modules::package::prepare_packages, pkg::PkgKey, util};
|
||||
use crate::{model::misc::Game, modules::package::prepare_packages, pkg::PkgKey, pkg_store::PackageStore, util};
|
||||
|
||||
pub mod ongeki;
|
||||
|
||||
@ -83,6 +83,26 @@ impl AnyProfile {
|
||||
}
|
||||
res
|
||||
}
|
||||
pub fn fix(&mut self, store: &PackageStore) {
|
||||
match self {
|
||||
Self::OngekiProfile(p) => p.sgt.fix(store)
|
||||
}
|
||||
}
|
||||
pub fn sync(&mut self, source: AnyProfile) {
|
||||
match self {
|
||||
Self::OngekiProfile(p) => {
|
||||
#[allow(irrefutable_let_patterns)]
|
||||
if let AnyProfile::OngekiProfile(source) = source {
|
||||
p.bepinex = source.bepinex;
|
||||
p.display = source.display;
|
||||
p.network = source.network;
|
||||
p.sgt = source.sgt;
|
||||
} else {
|
||||
log::error!("sync: invalid profile type {:?}", source);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
pub async fn line_up(&self, pkg_hash: String, _app: AppHandle) -> Result<()> {
|
||||
match self {
|
||||
Self::OngekiProfile(_p) => {
|
||||
|
Reference in New Issue
Block a user