Skip to content

Commit 5d8119e

Browse files
committed
undo the extension check in refresh_dir
1 parent c71d63c commit 5d8119e

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

tagstudio/src/core/utils/refresh_dir.py

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import structlog
77

8-
from src.core.constants import TS_FOLDER_NAME, LibraryPrefs
8+
from src.core.constants import TS_FOLDER_NAME
99
from src.core.library import Library, Entry
1010

1111
logger = structlog.get_logger(__name__)
@@ -44,20 +44,6 @@ def refresh_dir(self, lib_path: Path) -> Iterator[int]:
4444
if self.library.library_dir is None:
4545
raise ValueError("No library directory set.")
4646

47-
is_exclude_list = self.library.prefs(LibraryPrefs.IS_EXCLUDE_LIST)
48-
exclude_list = set(self.library.prefs(LibraryPrefs.EXTENSION_LIST))
49-
50-
def skip_suffix(suffix: str) -> bool:
51-
"""Determine if the file extension should be skipped.
52-
53-
Declared as local function as it's faster.
54-
55-
- check if the suffix is in the library's "exclude list"
56-
- if library uses "exclude mode", and extensions is in the list, we skip
57-
- if library uses "include mode", and extensions is not in the list, we skip
58-
"""
59-
return (suffix.lower() in exclude_list) == is_exclude_list
60-
6147
start_time_total = time()
6248
start_time_loop = time()
6349

@@ -72,9 +58,6 @@ def skip_suffix(suffix: str) -> bool:
7258
if "$RECYCLE.BIN" in str_path or TS_FOLDER_NAME in str_path:
7359
continue
7460

75-
if skip_suffix(path_item.suffix):
76-
continue
77-
7861
dir_file_count += 1
7962
relative_path = path_item.relative_to(lib_path)
8063
# TODO - load these in batch somehow

0 commit comments

Comments
 (0)