From cfbb75cc5a5609e5474f8b0f5bd56b5d08854c30 Mon Sep 17 00:00:00 2001 From: mos9527 Date: Wed, 15 Jan 2025 15:08:36 +0800 Subject: [PATCH] abcache.fs: Fix missing `ignore_size` flag usage (#17) --- .vscode/launch.json | 2 -- sssekai/abcache/__init__.py | 2 +- sssekai/abcache/fs.py | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 77821b9..b7c7f75 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -68,8 +68,6 @@ "3.4.0", "--app-appHash", "a3015fe8-785f-27e1-fb8b-546a23c82c1f", - "--dump-master-data", - "/Volumes/mos9527弄丢的盘/Reverse/proseka_reverse/masterdata/tw" ], "justMyCode": true }, diff --git a/sssekai/abcache/__init__.py b/sssekai/abcache/__init__.py index ae9f5b6..4fea630 100644 --- a/sssekai/abcache/__init__.py +++ b/sssekai/abcache/__init__.py @@ -376,7 +376,7 @@ def SEKAI_API_MASTER_SUITE_URLS(self): for path in self.database.sekai_user_auth_data.suiteMasterSplitPath ] # NOTE: All ROW servers have hardcoded master data URLs in *one* file as of the time of writing. - # NOTE: The MessagePack schema is also *omitted* in these endpoints. Good luck parsing them. + # NOTE: Some of the MessagePack schemas is also *omitted* in these endpoints. Good luck parsing them. case "tw": return [ "https://lf21-mkovscdn-sg.bytedgame.com/obj/sf-game-alisg/gdl_app_5245/MasterData/60001/master-data-138.info" diff --git a/sssekai/abcache/fs.py b/sssekai/abcache/fs.py index cda6833..ca1cfe3 100644 --- a/sssekai/abcache/fs.py +++ b/sssekai/abcache/fs.py @@ -64,7 +64,7 @@ def _fetch(self, start: int | None, stop: int | None) -> bytes: stop = self.size if not self.ignore_size: stop = min(stop, self.size) # XXX: why didn't fsspec handle this? - if start >= self.size or start >= stop: + if (not self.ignore_size and start >= self.size) or start >= stop: return b"" start_blk, start_pos = start // self.blocksize, start % self.blocksize end_blk, end_pos = stop // self.blocksize, stop % self.blocksize