summaryrefslogtreecommitdiff
path: root/src/LibraryFiles.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-11-12 16:48:02 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-11-12 16:48:02 +0100
commitabdaad68fb94e2d61448a6dfc14847df8a2c32b9 (patch)
tree26855c5dd3bfffdbf319d5ba4a38223a28de3e7c /src/LibraryFiles.vala
parent0f67b3cc674377559e66c5a6729fd499049a992f (diff)
parentdd7f98a232efe86f6e6055119c9414a0f9d9e67b (diff)
Merge branch 'feature/upstream' into develop
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());