Skip to content

Commit 2295296

Browse files
committed
Consider ArknightsAssets the primary source of yostar flatbuffer schemas
1 parent 2cb9e4d commit 2295296

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

arkprts/assets/bundle.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,13 @@ def run_flatbuffers(
126126
return pathlib.Path(output_directory) / (pathlib.Path(fbs_path).stem + ".json")
127127

128128

129-
def resolve_fbs_schema_directory(server: typing.Literal["cn", "yostar", "tw"]) -> pathlib.Path:
129+
def resolve_fbs_schema_directory(
130+
server: typing.Literal["cn", "yostar", "tw"],
131+
prefer_guess: bool = True,
132+
) -> pathlib.Path:
130133
"""Resolve the flatbuffers schema directory."""
131-
if server == "tw":
132-
return netn.APPDATA_DIR / "ArknightsFlatbuffers" / "tw"
134+
if server == "tw" or (server == "yostar" and prefer_guess):
135+
return netn.APPDATA_DIR / "ArknightsFlatbuffers" / server
133136

134137
core_path = netn.APPDATA_DIR / "ArknightsFBS"
135138
core_path.mkdir(parents=True, exist_ok=True)
@@ -140,11 +143,12 @@ def resolve_fbs_schema_directory(server: typing.Literal["cn", "yostar", "tw"]) -
140143
async def update_fbs_schema(*, force: bool = False) -> None:
141144
"""Download or otherwise update FBS files."""
142145
for server, branch in [("cn", "main"), ("yostar", "YoStar")]:
146+
assert server in ("cn", "yostar") # pyright regression
143147
if UPDATED_FBS[server] and not force:
144148
continue
145149

146150
UPDATED_FBS[server] = True
147-
directory = resolve_fbs_schema_directory(server).parent # pyright: ignore[reportArgumentType]
151+
directory = resolve_fbs_schema_directory(server, prefer_guess=False).parent
148152
await git.download_repository("MooncellWiki/OpenArknightsFBS", directory, branch=branch, force=force)
149153

150154
if not UPDATED_FBS["tw"] or force:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "arkprts"
33
requires-python = ">=3.9"
4-
version = "0.3.13"
4+
version = "0.3.14"
55
dynamic = [
66
"dependencies",
77
"description",

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name="arkprts",
8-
version="0.3.13",
8+
version="0.3.14",
99
description="Arknights python wrapper.",
1010
url="https://github.com/thesadru/arkprts",
1111
packages=find_packages(exclude=["tests", "tests.*"]),

0 commit comments

Comments
 (0)