Commit 76240755 authored by Tim Waugh's avatar Tim Waugh Committed by Jim Nelson

Use importable exposure time if available when importing media.

parent 585b3018
......@@ -157,6 +157,10 @@ public class DataImportJob : BatchImportJob {
string? title = src_photo.get_title();
if (title != null)
photo.set_title(title);
// exposure time
time_t? date_time = src_photo.get_exposure_time();
if (date_time != null)
photo.set_exposure_time(date_time);
// import ID
photo.set_import_id(import_roll.import_id);
......
......@@ -48,12 +48,16 @@ public class DataImportSource {
warning("Could not get file metadata for %s: %s", get_filename(), e.message);
metadata = null;
}
exposure_time = (metadata != null) ? metadata.get_exposure_date_time() : null;
title = db_photo.get_title();
if (title == null) {
title = (metadata != null) ? metadata.get_title() : null;
}
time_t? date_time = db_photo.get_exposure_time();
if (date_time != null) {
exposure_time = new MetadataDateTime(date_time);
} else {
exposure_time = (metadata != null) ? metadata.get_exposure_date_time() : null;
}
PhotoPreview? preview = metadata != null ? metadata.get_preview(0) : null;
if (preview != null) {
try {
......
......@@ -119,6 +119,8 @@ public interface ImportableMediaItem : GLib.Object {
public abstract string get_folder_path();
public abstract string get_filename();
public abstract time_t? get_exposure_time();
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment