Skip to content

Commit 1204d2b

Browse files
committed
Fix search ignoring case of extension list
1 parent 501ab1f commit 1204d2b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tagstudio/src/core/library.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -889,12 +889,12 @@ def refresh_dir(self) -> Generator:
889889
and "tagstudio_thumbs" not in f.parts
890890
and not f.is_dir()
891891
):
892-
if f.suffix not in self.ext_list and self.is_exclude_list:
892+
if f.suffix.lower() not in self.ext_list and self.is_exclude_list:
893893
self.dir_file_count += 1
894894
file = f.relative_to(self.library_dir)
895895
if file not in self.filename_to_entry_id_map:
896896
self.files_not_in_library.append(file)
897-
elif f.suffix in self.ext_list and not self.is_exclude_list:
897+
elif f.suffix.lower() in self.ext_list and not self.is_exclude_list:
898898
self.dir_file_count += 1
899899
file = f.relative_to(self.library_dir)
900900
try:
@@ -1382,7 +1382,7 @@ def search_library(
13821382
# non_entry_count = 0
13831383
# Iterate over all Entries =============================================================
13841384
for entry in self.entries:
1385-
allowed_ext: bool = entry.filename.suffix not in self.ext_list
1385+
allowed_ext: bool = entry.filename.suffix.lower() not in self.ext_list
13861386
# try:
13871387
# entry: Entry = self.entries[self.file_to_library_index_map[self._source_filenames[i]]]
13881388
# print(f'{entry}')
@@ -1539,7 +1539,7 @@ def add_entry(entry: Entry):
15391539
else:
15401540
for entry in self.entries:
15411541
added = False
1542-
allowed_ext = entry.filename.suffix not in self.ext_list
1542+
allowed_ext = entry.filename.suffix.lower() not in self.ext_list
15431543
if allowed_ext == self.is_exclude_list:
15441544
for f in entry.fields:
15451545
if self.get_field_attr(f, "type") == "collation":

tagstudio/src/qt/modals/file_extension.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,4 @@ def save(self):
110110
for i in range(self.table.rowCount()):
111111
ext = self.table.item(i, 0)
112112
if ext and ext.text():
113-
self.lib.ext_list.append(ext.text())
113+
self.lib.ext_list.append(ext.text().lower())

0 commit comments

Comments
 (0)