Skip to content

Commit

Permalink
Remove debugging assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
Edgiest05 committed May 14, 2024
1 parent 8734623 commit ffe41f7
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tagstudio/src/core/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,10 @@ def event_helper(self, filepath: str, time: int) -> None:
if "$RECYCLE.BIN" in filepath or "tagstudio_thumbs" in filepath:
return

assert not os.path.isdir(filepath)

if (
os.path.splitext(filepath)[1][1:].lower()
not in self.library.ignored_extensions
):
self.library.dir_file_count += 1
file = os.path.relpath(filepath, self.library.library_dir)

if os.name == "nt":
Expand All @@ -343,10 +340,9 @@ def event_helper(self, filepath: str, time: int) -> None:
id = self.library.filename_to_entry_id_map.get(file)

if id is None:
self.library.dir_file_count += 1
self.library.files_not_in_library.append(file)
new_ids = self.library.add_new_files_as_entries()
assert len(new_ids) == 1
id = new_ids[0]
self.library.add_new_files_as_entries()

self.callback()

Expand Down

0 comments on commit ffe41f7

Please sign in to comment.