mirror of
https://github.com/Bluemangoo/sekai-unpacker.git
synced 2026-09-20 00:06:52 +08:00
exact single file bundle
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user