Skip to content

Commit

Permalink
Revert "Fix create library + type checks"
Browse files Browse the repository at this point in the history
This reverts commit 6357fea.
  • Loading branch information
CyanVoxel committed May 21, 2024
1 parent 66ec091 commit 57e27bb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
21 changes: 10 additions & 11 deletions tagstudio/src/core/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,17 @@ def __eq__(self, __value: object) -> bool:
__value = cast(Self, object)
if os.name == "nt":
return (
int(self.id) == int(__value.id) #type: ignore
and self.filename.lower() == __value.filename.lower() #type: ignore
and self.path.lower() == __value.path.lower() #type: ignore
and self.fields == __value.fields #type: ignore
int(self.id) == int(__value.id)
and self.filename.lower() == __value.filename.lower()
and self.path.lower() == __value.path.lower()
and self.fields == __value.fields
)
else:
return (
int(self.id) == int(__value.id) #type: ignore
and self.filename == __value.filename #type: ignore
and self.path == __value.path #type: ignore
and self.fields == __value.fields #type: ignore
int(self.id) == int(__value.id)
and self.filename == __value.filename
and self.path == __value.path
and self.fields == __value.fields
)

def compressed_dict(self) -> JsonEntry:
Expand Down Expand Up @@ -450,9 +450,8 @@ def create_library(self, path) -> int:
path = os.path.normpath(path).rstrip("\\")

# If '.TagStudio' is included in the path, trim the path up to it.
if TS_FOLDER_NAME in str(path):
# TODO: Native Path method instead of this casting.
path = Path(str(path).split(TS_FOLDER_NAME)[0])
if TS_FOLDER_NAME in path:
path = path.split(TS_FOLDER_NAME)[0]

try:
self.clear_internal_vars()
Expand Down
2 changes: 1 addition & 1 deletion tagstudio/src/qt/ts_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,7 @@ def open_library(self, path):
self.save_library()
self.lib.clear_internal_vars()

self.main_window.statusbar.showMessage(f"Opening Library {str(path)}", 3)
self.main_window.statusbar.showMessage(f"Opening Library {path}", 3)
return_code = self.lib.open_library(path)
if return_code == 1:
# if self.args.external_preview:
Expand Down

0 comments on commit 57e27bb

Please sign in to comment.