Skip to content

Commit

Permalink
Version 0.5.9
Browse files Browse the repository at this point in the history
abcache.fs: Properly handle mismatching bundle sizes (#13)
The cache index (`AssetBundleInfo`) does NOT always report the correct bundle sizes (usually it's larger). For now we'd treat the extra part as EOF.
  • Loading branch information
mos9527 committed Dec 10, 2024
1 parent 21f5283 commit f8598cb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sssekai/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__VERSION_MAJOR__ = 0
__VERSION_MINOR__ = 5
__VERSION_PATCH__ = 8
__VERSION_PATCH__ = 9

__version__ = "%s.%s.%s" % (__VERSION_MAJOR__, __VERSION_MINOR__, __VERSION_PATCH__)
4 changes: 2 additions & 2 deletions sssekai/abcache/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def __resp(self) -> Response:
def __fetch(self):
def __innner():
for block in decrypt_iter(
lambda nbytes: next(self.__resp.iter_content(nbytes)), self.blocksize
lambda nbytes: next(self.__resp.iter_content(nbytes), b''), self.blocksize
):
yield bytes(block)

Expand All @@ -113,7 +113,7 @@ def __innner():
def _fetch_range(self, start, end):
assert start - self.fetch_loc == 0, "can only fetch sequentially"
self.fetch_loc = end
return next(self.__fetch)
return next(self.__fetch, b'')


# Reference: https://github.com/fsspec/filesystem_spec/blob/master/fsspec/implementations/libarchive.py
Expand Down
1 change: 1 addition & 0 deletions sssekai/entrypoint/abcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def _download(self, src: AbCacheFile, dest: str):
return
except Exception as e:
logger.error("While downloading %s : %s. Retrying" % (src.path, e))
raise e
if _ == RETRIES - 1:
logger.critical("Did not download %s" % src.path)
self._ensure_progress()
Expand Down

0 comments on commit f8598cb

Please sign in to comment.