Skip to content
Open
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)
autoload_new_files: bool = Field(default=False)
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)

# Autoload new files
self.autoload_new_files_checkbox = QCheckBox()
self.autoload_new_files_checkbox.setChecked(self.driver.settings.autoload_new_files)
form_layout.addRow(
Translations["media_player.autoload_new_files"], self.autoload_new_files_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(),
"auto_load_new_files": self.autoload_new_files_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.autoload_new_files = settings["auto_load_new_files"]
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
4 changes: 2 additions & 2 deletions src/tagstudio/qt/ts_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1649,8 +1649,8 @@ 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:
# Autoloading will happen in both cases, so most users won't need to turn the setting on
if self.lib.entries_count < 10_000 or self.settings.autoload_new_files:
self.add_new_files_callback()

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 @@ -206,6 +206,7 @@
"macros.running.dialog.new_entries": "Running Configured Macros on {count}/{total} New File Entries...",
"macros.running.dialog.title": "Running Macros on New Entries",
"media_player.autoplay": "Autoplay",
"media_player.autoload_new_files": "Automatically Load New Files",
"media_player.loop": "Loop",
"menu.delete_selected_files_ambiguous": "Move File(s) to {trash_term}",
"menu.delete_selected_files_plural": "Move Files to {trash_term}",
Expand Down