exact single file bundle

This commit is contained in:
2026-04-14 18:01:42 +08:00
parent 83279e0253
commit c015383f1d
6 changed files with 52 additions and 24 deletions
+2 -2
View File
@@ -157,7 +157,7 @@ impl AssetExecutionContext {
&self,
task: &DownloadTask,
app_config: &AppConfig,
) -> Result<PathBuf, AssetExecutionError> {
) -> Result<(PathBuf, /*single file*/ bool), AssetExecutionError> {
let ctx = self.clone();
ctx.download_and_export_bundle(app_config, task).await
}
@@ -400,7 +400,7 @@ impl AssetExecutionContext {
&self,
app_config: &AppConfig,
task: &DownloadTask,
) -> Result<PathBuf, AssetExecutionError> {
) -> Result<(PathBuf, bool), AssetExecutionError> {
let bundle_url = self.render_bundle_url(task)?;
let body = self.get_with_retry(&bundle_url).await?;
let deobfuscated = deobfuscate(&body);
+6 -3
View File
@@ -61,13 +61,13 @@ pub async fn extract_unity_asset_bundle(
asset_bundle_file: &Path,
export_path: &str,
category: &str,
) -> Result<PathBuf, ExportPipelineError> {
) -> Result<(PathBuf, bool), ExportPipelineError> {
let output_dir = std::env::temp_dir()
.join("sekai-updater")
.join("extract")
.join(&sync_context.region);
let Some(asset_studio_cli_path) = app_config.tools.asset_studio_cli_path.as_deref() else {
return Ok(asset_bundle_file.parent().unwrap().to_path_buf());
return Ok((asset_bundle_file.parent().unwrap().to_path_buf(), true));
};
let exclude_path_prefix = if sync_context.export.by_category {
@@ -125,8 +125,11 @@ pub async fn extract_unity_asset_bundle(
)
.await?;
let mut count = 0;
walk(&actual_export_path, &mut |_| count += 1)?;
post_process_exported_files(app_config, sync_context, region, &actual_export_path).await?;
Ok(actual_export_path)
Ok((actual_export_path, count <= 1))
}
pub async fn post_process_exported_files(