summaryrefslogtreecommitdiff
path: root/raphodo/preferences.py
diff options
context:
space:
mode:
Diffstat (limited to 'raphodo/preferences.py')
-rw-r--r--raphodo/preferences.py51
1 files changed, 43 insertions, 8 deletions
diff --git a/raphodo/preferences.py b/raphodo/preferences.py
index c532771..fb5c46f 100644
--- a/raphodo/preferences.py
+++ b/raphodo/preferences.py
@@ -44,7 +44,7 @@ from raphodo.rpdfile import ALL_KNOWN_EXTENSIONS
class ScanPreferences:
r"""
Handle user preferences while scanning devices like memory cards,
- cameras or the filesystem. Pickled and passed between processes.
+ cameras or the filesystem.
Sets data attribute valid to True if ignored paths are valid. An ignored
path is always assumed to be valid unless regular expressions are used.
@@ -302,19 +302,29 @@ class Preferences:
job_code_sort_key=0,
job_code_sort_order=0,
did_you_know_on_startup=True,
- did_you_know_index=0
+ did_you_know_index=0,
+ # see constants.CompletedDownloads:
+ completed_downloads=3,
+ consolidate_identical=True,
+ # see constants.TreatRawJpeg:
+ treat_raw_jpeg=2,
+ # see constants.MarkRawJpeg:
+ mark_raw_jpeg=3,
)
device_defaults = dict(
only_external_mounts=True,
device_autodetection=True,
this_computer_source = False,
this_computer_path='',
- device_without_dcim_autodetection=False,
+ scan_specific_folders=True,
+ # pre 0.9.3a1 value: device_without_dcim_autodetection=False, is now replaced by
+ # scan_specific_folders
+ folders_to_scan=['DCIM', 'PRIVATE', 'MP_ROOT'],
+ ignored_paths=['.Trash', '.thumbnails'],
+ use_re_ignored_paths=False,
volume_whitelist=[''],
volume_blacklist=[''],
camera_blacklist=[''],
- ignored_paths=['.Trash', '.thumbnails'],
- use_re_ignored_paths=False
)
backup_defaults = dict(
backup_files=False,
@@ -896,11 +906,11 @@ class Preferences:
self.settings.endGroup()
v090b6 = pkg_resources.parse_version('0.9.0b6')
-
- if previous_version < v090b6 and not self.value_is_set('warn_broken_or_missing_libraries'):
+ key = 'warn_broken_or_missing_libraries'
+ group = 'Display'
+ if previous_version < v090b6 and not self.value_is_set(key, group):
# Versions prior to 0.9.0b6 may have a preference value 'warn_no_libmediainfo'
# which is now renamed to 'broken_or_missing_libraries'
- group = 'Display'
if self.value_is_set('warn_no_libmediainfo', group):
self.settings.beginGroup(group)
v = self.settings.value('warn_no_libmediainfo', True, type(True))
@@ -917,6 +927,31 @@ class Preferences:
"warn_broken_or_missing_libraries because it doesn't exist"
)
+ v093a1 = pkg_resources.parse_version('0.9.3a1')
+ key = 'scan_specific_folders'
+ group = 'Device'
+ if previous_version < v093a1 and not self.value_is_set(key, group):
+ # Versions prior to 0.9.3a1 used a preference value to indicate if
+ # devices lacking a DCIM folder should be scanned. It is now renamed
+ # to 'scan_specific_folders'
+ if self.value_is_set('device_without_dcim_autodetection'):
+ self.settings.beginGroup(group)
+ v = self.settings.value('device_without_dcim_autodetection', True, type(True))
+ self.settings.remove('device_without_dcim_autodetection')
+ self.settings.endGroup()
+ self.settings.endGroup()
+ logging.debug(
+ "Transferring preference value %s for device_without_dcim_autodetection to "
+ "scan_specific_folders as %s", v, not v
+ )
+ self.scan_specific_folders = not v
+ else:
+ logging.debug(
+ "Not transferring preference value device_without_dcim_autodetection to "
+ "scan_specific_folders because it doesn't exist"
+ )
+
+
def validate_max_CPU_cores(self) -> None:
logging.debug('Validating CPU core count for thumbnail generation...')
available = available_cpu_count(physical_only=True)