feat: chusanApp.exe patching
This commit is contained in:
@ -8,7 +8,7 @@ use tokio::task::JoinSet;
|
||||
use crate::model::local::{PackageList, PackageListEntry};
|
||||
use crate::model::misc::Game;
|
||||
use crate::model::rainy;
|
||||
use crate::pkg::{Package, PackageSource, PkgKey, Remote, Status};
|
||||
use crate::pkg::{Feature, Package, PackageSource, PkgKey, Remote, Status};
|
||||
use crate::util;
|
||||
use crate::download_handler::DownloadHandler;
|
||||
|
||||
@ -67,6 +67,21 @@ impl PackageStore {
|
||||
.collect()
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn get_by_feature(&self, feature: Feature) -> Vec<PkgKey> {
|
||||
self.store.iter()
|
||||
.filter(|(_, v)| {
|
||||
if let Some(loc) = &v.loc {
|
||||
if let Status::OK(flags, _) = loc.status {
|
||||
return flags.contains(feature);
|
||||
}
|
||||
}
|
||||
return false
|
||||
})
|
||||
.map(|(k, _)| k.clone())
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub async fn reload_package(&mut self, key: PkgKey) {
|
||||
let dir = util::pkg_dir().join(&key.0);
|
||||
if let Ok(pkg) = Package::from_dir(dir, PackageSource::Rainy).await {
|
||||
|
Reference in New Issue
Block a user