Skip to content

Commit 57e27bb

Browse files
committed
Revert "Fix create library + type checks"
This reverts commit 6357fea.
1 parent 66ec091 commit 57e27bb

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

tagstudio/src/core/library.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,17 @@ def __eq__(self, __value: object) -> bool:
8989
__value = cast(Self, object)
9090
if os.name == "nt":
9191
return (
92-
int(self.id) == int(__value.id) #type: ignore
93-
and self.filename.lower() == __value.filename.lower() #type: ignore
94-
and self.path.lower() == __value.path.lower() #type: ignore
95-
and self.fields == __value.fields #type: ignore
92+
int(self.id) == int(__value.id)
93+
and self.filename.lower() == __value.filename.lower()
94+
and self.path.lower() == __value.path.lower()
95+
and self.fields == __value.fields
9696
)
9797
else:
9898
return (
99-
int(self.id) == int(__value.id) #type: ignore
100-
and self.filename == __value.filename #type: ignore
101-
and self.path == __value.path #type: ignore
102-
and self.fields == __value.fields #type: ignore
99+
int(self.id) == int(__value.id)
100+
and self.filename == __value.filename
101+
and self.path == __value.path
102+
and self.fields == __value.fields
103103
)
104104

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

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

457456
try:
458457
self.clear_internal_vars()

tagstudio/src/qt/ts_qt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,7 @@ def open_library(self, path):
13921392
self.save_library()
13931393
self.lib.clear_internal_vars()
13941394

1395-
self.main_window.statusbar.showMessage(f"Opening Library {str(path)}", 3)
1395+
self.main_window.statusbar.showMessage(f"Opening Library {path}", 3)
13961396
return_code = self.lib.open_library(path)
13971397
if return_code == 1:
13981398
# if self.args.external_preview:

0 commit comments

Comments
 (0)