Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/tagstudio/qt/global_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class GlobalSettings(BaseModel):
cached_thumb_quality: int = Field(default=DEFAULT_CACHED_IMAGE_QUALITY)
cached_thumb_resolution: int = Field(default=DEFAULT_CACHED_IMAGE_RES)
autoplay: bool = Field(default=True)
scan_files_on_open: bool = Field(default=True)
loop: bool = Field(default=True)
show_filenames_in_grid: bool = Field(default=True)
page_size: int = Field(default=100)
Expand Down
9 changes: 9 additions & 0 deletions src/tagstudio/qt/mixed/settings_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,13 @@ def __build_global_settings(self):
self.autoplay_checkbox.setChecked(self.driver.settings.autoplay)
form_layout.addRow(Translations["media_player.autoplay"], self.autoplay_checkbox)

# Scan for new files when a library is opened
self.scan_files_on_open_checkbox = QCheckBox()
self.scan_files_on_open_checkbox.setChecked(self.driver.settings.scan_files_on_open)
form_layout.addRow(
Translations["settings.scan_files_on_open"], self.scan_files_on_open_checkbox
)

# Show Filenames in Grid
self.show_filenames_checkbox = QCheckBox()
self.show_filenames_checkbox.setChecked(self.driver.settings.show_filenames_in_grid)
Expand Down Expand Up @@ -295,6 +302,7 @@ def get_settings(self) -> dict[str, Any]: # pyright: ignore[reportExplicitAny]
MIN_THUMB_CACHE_SIZE,
),
"autoplay": self.autoplay_checkbox.isChecked(),
"scan_files_on_open": self.scan_files_on_open_checkbox.isChecked(),
"show_filenames_in_grid": self.show_filenames_checkbox.isChecked(),
"page_size": int(self.page_size_line_edit.text()),
"infinite_scroll": self.infinite_scroll.isChecked(),
Expand All @@ -313,6 +321,7 @@ def update_settings(self, driver: "QtDriver"):
driver.settings.language = settings["language"]
driver.settings.open_last_loaded_on_startup = settings["open_last_loaded_on_startup"]
driver.settings.autoplay = settings["autoplay"]
driver.settings.scan_files_on_open = settings["scan_files_on_open"]
driver.settings.generate_thumbs = settings["generate_thumbs"]
driver.settings.thumb_cache_size = settings["thumb_cache_size"]
driver.settings.show_filenames_in_grid = settings["show_filenames_in_grid"]
Expand Down
3 changes: 1 addition & 2 deletions src/tagstudio/qt/ts_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1649,8 +1649,7 @@ def _init_library(self, path: Path, open_status: LibraryStatus):
Ignore.get_patterns(self.lib.library_dir, include_global=True)
self.__reset_navigation()

# TODO - make this call optional
if self.lib.entries_count < 10000:
if self.settings.scan_files_on_open:
self.add_new_files_callback()
Comment thread
CyanVoxel marked this conversation as resolved.

if self.settings.show_filepath == ShowFilepathOption.SHOW_FULL_PATHS:
Expand Down
1 change: 1 addition & 0 deletions src/tagstudio/resources/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@
"settings.open_library_on_start": "Open Library on Start",
"settings.page_size": "Page Size",
"settings.restart_required": "Please restart TagStudio for changes to take effect.",
"settings.scan_files_on_open": "Automatically Load New Files",
"settings.show_filenames_in_grid": "Show Filenames in Grid",
"settings.show_recent_libraries": "Show Recent Libraries",
"settings.splash.label": "Splash Screen",
Expand Down
Loading