Skip to content

Commit

Permalink
build: avoid downloading unused resources
Browse files Browse the repository at this point in the history
  • Loading branch information
gudzpoz committed Jun 27, 2024
1 parent 98f24dc commit 039b0af
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ jobs:
run: |
cd unpack
source .venv/bin/activate
mkdir -p downloader/resdata
cp gf-data-ch/resdata_no_hash.json downloader/resdata/ch_resdata.json
git apply ../downloader.patch
cd downloader
zip -j resdata.zip resdata/ch_resdata.json
python downloader.py --downloadres 0 --abname
Expand Down
34 changes: 34 additions & 0 deletions unpack/downloader.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
diff --git a/downloader.py b/downloader.py
index f81ca28..e5b6536 100644
--- a/downloader.py
+++ b/downloader.py
@@ -139,6 +139,20 @@ if __name__ == "__main__":
res_path = os.path.join(
out_dir, abname if config["use_abname"] else resname
)
+ if (
+ abname == "asset_particlesother.ab"
+ or abname == "asset_fonts.ab"
+ or abname.startswith("asset_guide")
+ or abname.startswith("asset_map")
+ or abname.startswith("atlasclips_")
+ or abname.startswith("resource_icon_")
+ or abname.startswith("resource_card")
+ or abname.startswith("sprites_")
+ or abname.startswith("live2d")
+ or abname.endswith("_spine.ab")
+ or abname.endswith("_furniture.ab")
+ ):
+ continue
if os.path.exists(res_path):
if os.path.getsize(res_path) == size:
logger.info(f"File {resname} already exists, thus will be skipped")
@@ -155,6 +169,8 @@ if __name__ == "__main__":
res_path = os.path.join(
out_dir, abname if config["use_abname"] else resname
)
+ if abname.endswith(".usm.dat"):
+ continue
if os.path.exists(res_path):
if os.path.getsize(res_path) == size:
logger.info(f"File {resname} already exists, thus will be skipped")

0 comments on commit 039b0af

Please sign in to comment.