mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-05-11 14:53:51 +00:00
feat: add ability to configure automatic loading of new files over 10000 (#1349)
* feat: add ability to configure automatic loading of new files over 10000 * Renaming things * rename and reorder * fix: remove duplicated add_new_files_callback() call
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -176,6 +176,13 @@ class SettingsPanel(PanelWidget):
|
||||
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)
|
||||
@@ -295,6 +302,7 @@ class SettingsPanel(PanelWidget):
|
||||
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(),
|
||||
@@ -313,6 +321,7 @@ class SettingsPanel(PanelWidget):
|
||||
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"]
|
||||
|
||||
@@ -1650,8 +1650,7 @@ class QtDriver(DriverMixin, QObject):
|
||||
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()
|
||||
|
||||
if self.settings.show_filepath == ShowFilepathOption.SHOW_FULL_PATHS:
|
||||
|
||||
@@ -272,6 +272,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",
|
||||
|
||||
Reference in New Issue
Block a user