Skip to content

Commit

Permalink
hopefully fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
Thesacraft committed Jun 6, 2024
1 parent 5d4d7f1 commit 749ea49
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions tagstudio/src/core/json_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class JsonLibary(TypedDict("", {"ts-version": str})):
entries: "list[JsonEntry]"
ext_list: list[str]
is_exclude_list: bool
ignored_extensions: list[str]


class JsonBase(TypedDict):
Expand Down
9 changes: 4 additions & 5 deletions tagstudio/src/core/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,11 +502,10 @@ def open_library(self, path: str | Path) -> int:
major, minor, patch = json_dump["ts-version"].split(".")

# Load Extension Exclude List ---------------------------------
# The following if statment is only used when a old library is loaded
if "ignored_extensions" in json_dump:
self.ext_list = json_dump["ignored_extensions"]
if "ext_list" in json_dump:
self.ext_list = json_dump["ext_list"]
self.ext_list = json_dump.get("ext_list") or json_dump.get(
"ignored_extensions"
)

if "is_exclude_list" in json_dump:
self.is_exclude_list = json_dump["is_exclude_list"]
# Parse Tags ---------------------------------------------------
Expand Down

0 comments on commit 749ea49

Please sign in to comment.