feat: skeleton of proper local package support

This commit is contained in:
2025-04-10 14:07:44 +00:00
parent d63d81e349
commit ff0a37dfdc
2 changed files with 26 additions and 9 deletions

View File

@ -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, PkgKey, Remote, Status};
use crate::pkg::{Package, PackageSource, PkgKey, Remote, Status};
use crate::util;
use crate::download_handler::DownloadHandler;
@ -69,7 +69,7 @@ impl PackageStore {
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).await {
if let Ok(pkg) = Package::from_dir(dir, PackageSource::Rainy).await {
self.update_nonremote(key, pkg);
} else {
log::error!("couldn't reload {}", key);
@ -83,7 +83,7 @@ impl PackageStore {
for dir in dirents {
if let Ok(dir) = dir {
let path = dir.path();
futures.spawn(Package::from_dir(path));
futures.spawn(Package::from_dir(path, PackageSource::Rainy));
}
}