Skip to content

Commit

Permalink
Fix search ignoring case of extension list
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanVoxel committed Jun 21, 2024
1 parent 501ab1f commit 1204d2b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions tagstudio/src/core/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -889,12 +889,12 @@ def refresh_dir(self) -> Generator:
and "tagstudio_thumbs" not in f.parts
and not f.is_dir()
):
if f.suffix not in self.ext_list and self.is_exclude_list:
if f.suffix.lower() not in self.ext_list and self.is_exclude_list:
self.dir_file_count += 1
file = f.relative_to(self.library_dir)
if file not in self.filename_to_entry_id_map:
self.files_not_in_library.append(file)
elif f.suffix in self.ext_list and not self.is_exclude_list:
elif f.suffix.lower() in self.ext_list and not self.is_exclude_list:
self.dir_file_count += 1
file = f.relative_to(self.library_dir)
try:
Expand Down Expand Up @@ -1382,7 +1382,7 @@ def search_library(
# non_entry_count = 0
# Iterate over all Entries =============================================================
for entry in self.entries:
allowed_ext: bool = entry.filename.suffix not in self.ext_list
allowed_ext: bool = entry.filename.suffix.lower() not in self.ext_list
# try:
# entry: Entry = self.entries[self.file_to_library_index_map[self._source_filenames[i]]]
# print(f'{entry}')
Expand Down Expand Up @@ -1539,7 +1539,7 @@ def add_entry(entry: Entry):
else:
for entry in self.entries:
added = False
allowed_ext = entry.filename.suffix not in self.ext_list
allowed_ext = entry.filename.suffix.lower() not in self.ext_list
if allowed_ext == self.is_exclude_list:
for f in entry.fields:
if self.get_field_attr(f, "type") == "collation":
Expand Down
2 changes: 1 addition & 1 deletion tagstudio/src/qt/modals/file_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,4 @@ def save(self):
for i in range(self.table.rowCount()):
ext = self.table.item(i, 0)
if ext and ext.text():
self.lib.ext_list.append(ext.text())
self.lib.ext_list.append(ext.text().lower())

0 comments on commit 1204d2b

Please sign in to comment.