summaryrefslogtreecommitdiff
path: root/src/LibraryFiles.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-12-15 20:38:57 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-12-15 20:38:57 +0100
commitf1353e9ffd34db5f755c7da0b3f9c10638fbfd38 (patch)
treea1f2ab30332a6383b0677bfcc2aec687b98851d6 /src/LibraryFiles.vala
parentf8ca421bdacee8851965a4b802ada1d2366bdbc1 (diff)
parentede50c561ec9811704821a9ea0f04c3d6c20b5af (diff)
Merge branch 'release/0.26.4-1'0.26.4-1
Diffstat (limited to 'src/LibraryFiles.vala')
-rw-r--r--src/LibraryFiles.vala18
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());