Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

Commit

Permalink
fixed entry in galleries_modified not being created sometimes
Browse files Browse the repository at this point in the history
  • Loading branch information
9FS committed Dec 13, 2023
1 parent c37dc91 commit 9e56af0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ license = "MIT"
name = "x" # can't leave empty because of bug with `poetry install` from poetry.lock file
readme = "readme.md"
repository = "https://github.com/9-FS/2022-10-23-nHentai-to-PDF-Server"
version = "3.0.1"
version = "3.0.2"

[tool.poetry.dependencies]
kfsconfig = "^1.0.0"
Expand Down
3 changes: 2 additions & 1 deletion src/Hentai.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ def _get_gallery(cls, nhentai_ID: int, cookies: dict[str, str], headers: dict[st
elif os.path.isfile(gallery_list_filepath)==True: # if gallery could not be loaded from class variable and appropiate galleries file exists: try to load from file
with open(gallery_list_filepath, "rt") as galleries_file:
try:
cls.galleries[nhentai_ID//cls.GALLERIES_SPLIT]=json.loads(galleries_file.read()) # load already downloaded galleries, overwrite class variable
cls.galleries[nhentai_ID//cls.GALLERIES_SPLIT]=json.loads(galleries_file.read()) # load already downloaded galleries, overwrite or create entry class variable
cls.galleries_modified[nhentai_ID//cls.GALLERIES_SPLIT]=False # overwrite or create netry in modified variable, galleries have not been modified, don't save during next save turn
except ValueError as e: # if file is corrupted:
logging.critical(f"Parsing galleries from \"{gallery_list_filepath}\" failed with {KFSfstr.full_class_name(e)}. Check it for errors.")
raise RuntimeError(f"Error in {Hentai._get_gallery.__name__}{inspect.signature(Hentai._get_gallery)}: Parsing galleries from \"{gallery_list_filepath}\" failed with {KFSfstr.full_class_name(e)}. Check it for errors.") from e
Expand Down

0 comments on commit 9e56af0

Please sign in to comment.