diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-11-12 15:53:58 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-11-12 15:53:58 +0100 |
commit | 2492891f112caac6076ce49721d9d5d78a152c3a (patch) | |
tree | 36dd11a60bd963e6bd44e2e312b6e4b57d1849ea /src/LibraryFiles.vala | |
parent | 3c829c50a8f705402bdc759946d49ae7caebd003 (diff) |
New upstream version 0.26.4upstream/0.26.4
Diffstat (limited to 'src/LibraryFiles.vala')
-rw-r--r-- | src/LibraryFiles.vala | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/LibraryFiles.vala b/src/LibraryFiles.vala index 20d43ab..a49b77b 100644 --- a/src/LibraryFiles.vala +++ b/src/LibraryFiles.vala @@ -36,13 +36,23 @@ public File? generate_unique_file(string basename, MediaMetadata? metadata, time } // Optionally convert to lower-case. - string newbasename = basename; - if (Config.Facade.get_instance().get_use_lowercase_filenames()) - newbasename = newbasename.down(); + string newbasename = convert_basename(basename); return global::generate_unique_file(dir, newbasename, out collision); } +// Create the basename for files in the library. +// Depending on the setting USE_LOWERCASE_FILENAMES the basename will be converted to lower case or not +public string convert_basename(string basename) { + if (Config.Facade.get_instance().get_use_lowercase_filenames()) { + return basename.down(); + } else { + return basename; + } + +} + + // This function is thread-safe. private File duplicate(File src, FileProgressCallback? progress_callback, bool blacklist) throws Error { time_t timestamp = 0; @@ -59,7 +69,7 @@ private File duplicate(File src, FileProgressCallback? progress_callback, bool b metadata = reader.read_metadata(); } catch (Error err) { // ignored, leave metadata as null - } + } } else { PhotoFileReader reader = PhotoFileFormat.get_by_file_extension(src).create_reader( src.get_path()); |