mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2024-07-30 21:27:34 +00:00
Fix create library + type checks
This commit is contained in:
parent
491ebb6714
commit
6357fea8db
2 changed files with 12 additions and 11 deletions
|
@ -89,17 +89,17 @@ class Entry:
|
|||
# __value = cast(Self, object)
|
||||
if os.name == "nt":
|
||||
return (
|
||||
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
|
||||
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
|
||||
)
|
||||
else:
|
||||
return (
|
||||
int(self.id) == int(__value.id)
|
||||
and self.filename == __value.filename
|
||||
and self.path == __value.path
|
||||
and self.fields == __value.fields
|
||||
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
|
||||
)
|
||||
|
||||
def compressed_dict(self) -> JsonEntry:
|
||||
|
@ -448,8 +448,9 @@ class Library:
|
|||
"""
|
||||
|
||||
# If '.TagStudio' is included in the path, trim the path up to it.
|
||||
if TS_FOLDER_NAME in path:
|
||||
path = path.split(TS_FOLDER_NAME)[0]
|
||||
if TS_FOLDER_NAME in str(path):
|
||||
# TODO: Native Path method instead of this casting.
|
||||
path = Path(str(path).split(TS_FOLDER_NAME)[0])
|
||||
|
||||
try:
|
||||
self.clear_internal_vars()
|
||||
|
|
|
@ -1394,7 +1394,7 @@ class QtDriver(QObject):
|
|||
self.save_library()
|
||||
self.lib.clear_internal_vars()
|
||||
|
||||
self.main_window.statusbar.showMessage(f"Opening Library {path}", 3)
|
||||
self.main_window.statusbar.showMessage(f"Opening Library {str(path)}", 3)
|
||||
return_code = self.lib.open_library(path)
|
||||
if return_code == 1:
|
||||
pass
|
||||
|
|
Loading…
Reference in a new issue